cmdparser

0.1.0 • Public • Published

cmdparser

Command parser with support for completers.

Made specifically to parse redis command syntax but can be used for other purposes as well.

Install

$ npm install cmdparser

Example

var cmdparser = new CmdParser([
  "del <key> [key ...]",
  "dump <key>",
  "exists <key>"
], {
  key: function (partial) {
    return ["1111", "1112", "1113"];
  }
});
var results = cmdparser.completer("dump 111");
// results = [ ["1111", "1112", "1113"], "111" ]

Readme

Keywords

Package Sidebar

Install

npm i cmdparser

Weekly Downloads

3,235

Version

0.1.0

License

none

Unpacked Size

30.4 kB

Total Files

7

Last publish

Collaborators

  • joeferner