vantage-command-proxy
Version:
Info Proxy for vantage.js commands
72 lines (53 loc) • 1.47 kB
Markdown
for vantage.js commands
This allow command statements to be routed through vcp to be listable with the version command
(this will be used in all my vantage plugins)
##### Installation
```bash
npm install vantage
npm install vantage-command-proxy
```
##### Programmatic use
```js
// index.js
// path: where to find your module's package.json (__dirname if the json is next to this script)
// cmd: what 'base' cmd should be used for the version command
var Vantage = require('vantage-command-proxy')(require('vantage')(), {path:__dirname, cmd:'test'})
;
Vantage
.Proxy
.command('test', 'tests proxy')
.action(function(cmd,cb) {
cb('this has no logic');
});
Vantage
.Proxy
.mode('test2')
.delimiter( 'test2>' )
.description('tests proxy, too')
.action(function(cmd,cb) {
cb('this has no logic (2)');
});
Vantage
.delimiter('node~$')
.show();
```
it adds a version group command, that all modules may use to add their version
```
node~$ version
Commands:
version xyzmodule the-xyzmodule version ?.?.?
```
You may open the help to see its details, and possible commands (example)
```
node~$ version xyzmodule
Author
* Nabil Redmann (BananaAcid)
* bananaacid.de
INFO
* Info Proxy for vantage.js commands
Commands:
- version xyzmodule
- xyzmodule
```
Info Proxy