npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wechaty-vorpal-contrib

v1.12.1

Published

Wechaty Chat CLI (Command Line Interface), Powered by Vorpal

Downloads

109

Readme

wechaty-vorpal-contrib

Wechaty Vorpal Contrib NPM NPM Version

Wechaty Vorpal Chat CLI (Command Line Interface)

Wechaty Vorpal Contrib

Image: Tales of Zestiria

Requirements

  1. Node.js v16+
  2. NPM v7+
  3. Wechaty v0.40+
  4. WechatyVorpal v0.2+

Usage

You are welcome to send your Vorpal Extension to our contrib by creating a Pull Request!

| # | Extension | Author | Feature | | :--- | :--- | :--- | :--- | | 1 | Ding | @huan | Get a reply of dong | | 2 | Eval | @huan | Run JavaSCript in your Wechaty bot right in the chat window! | | 3 | Cash | @huan | Cross-platform Linux commands in pure ES6 | | 4 | MathMaster | @huan | Text game on WeChat: to become a math master! | | 5 | Whoru | @huan | Make the bot do a introduction about itself | | 6 | Version | @huan | Show the dependencies/devDependencies of the bot |

import { Wechaty }        from 'wechaty'
import { WechatyVorpal }  from 'wechaty-vorpal'
import { Eval }           from 'wechaty-vorpal-contrib'

const vorpalExtensionList = [
  Eval(), // <- Put our vorpal contrib extensions at here.
]

const VorpalPlugin = WechatyVorpal({
  room: 'Your_Vorpal_CLI_Room_ID',
  use: vorpalExtensionList,
})

const wechaty = new Wechaty()
wechaty.use(VorpalPlugin)

Screenshot

UrlLink

Wechaty Vorpal UrlLink Extension

Eval

Wechaty Vorpal Eval Extension

Commands

Wechaty Vorpal Contrib

The Wechaty Vorpal Contrib includes the most useful commands from the Wechaty Contributors.

If you believe we should add more command to the contrib, please feel free to submit an proposal by creating an new issue, with your code in the PR!

1 Ding

import { Ding } from 'wechaty-vorpal-contrib'
vorpalExtensionList = [ Ding() ]

2 Eval

import { Eval } from 'wechaty-vorpal-contrib'
vorpalExtensionList = [ Eval() ]

Eval Example

To remove a member from a room, you can use the following eval code to achieve that:

eval
  const ROOM_TOPIC_RE=/Home 6/i;
  const MEMBER_NAME_RE=/纸超人/i;
  const room = await this.wechaty.Room.find({ topic: ROOM_TOPIC_RE });
  const memberList = await room.memberAll();
  const bob = memberList.filter(m => MEMBER_NAME_RE.test(m.name()))[0];
  await room.say("You have violated the code of conduct of our Wechaty Developers's Room, we need to move you out of this room.", bob);
  await this.wechaty.sleep(5000);
  await room.say('done');
  await room.del(bob);
  await this.log('done');

3 Cash

Cash is a cross-platform implementation of Unix shell commands written in straight ES6. No native compiling and no external dependencies.

import { Cash } from 'wechaty-vorpal-contrib'
vorpalExtensionList = [ Cash() ]
$ help

  Commands:

    alias [options] [name...]
    cat [options] [files...]
    cd [dir]
    clear
    cp [options] [args...]
    echo [options] [arg...]
     [options] [files...]
    export [options] [name...]
    false
    kill [options] [process...]
    ls [options] [paths...]
     [options] [directory...]
     [options] [args...]
    pwd [files...]
    sort [options] [files...]
    source [file] [params...]
    tail [options] [files...]
    touch [options] <files...>
    true
    grep [options] <pattern> [files...]  Grep (POSIX) implementation.
    rm [options] [files...]
     [options] [name...]

This extension is powered by Cash.

Learn more supported command at https://github.com/dthree/cash#supported-commands

4 MathMaster

Play game in WeChat and make you a master of math! (leader board support)

Wechaty Vorpal Math Master

import { MathMaster } from 'wechaty-vorpal-contrib'
vorpalExtensionList = [ MathMaster() ]

5 Whoru

Let the bot tell you about its version & server information.

import { Whoru } from 'wechaty-vorpal-contrib'
vorpalExtensionList = [ Whoru() ]

6 Version

Let the bot tell you its dependencies/devDependencies.

import { Version } from 'wechaty-vorpal-contrib'
vorpalExtensionList = [ Version() ]

Contributors

contributor contributor contributor contributor contributor contributor contributor contributor

History

main v1.0 (Oct 23, 2021)

Release v1.0 of Wechaty Vorpal Contrib.

  1. (Sep 20, 2021): Enable ESM Modules

v0.6 (July 10, 2020)

  1. Upgrade to wechaty-vorpal@0.6 to enhance the Command Action Functions
  2. MathMaster Extension for play game in WeChat!
  3. Add Whoru and Version extensions.

v0.2 (June 19, 2020)

Init the first version of Wechaty Vorpal Extensions for official Wechaty ChatOps Commands

  1. Ding Extension for trigger a dong reply
  2. Eval Extension for EVAL JavaScript code from the chat window!
  3. Cash Extension for Cross-platform Linux commands in pure ES6

Author

Huan LI (李卓桓), Tencent TVP of Chatbot, <[email protected]>

Profile of Huan LI (李卓桓) on StackOverflow

Copyright & License

  • Code & Docs © 2020 Huan LI (李卓桓) <[email protected]>
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons