vnjson-cmd
v0.1.4
Published
Wrapper for process.argv based EventEmitter
Downloads
2
Readme
vnjson-cmd
commander for bash
Install
npm install --save vnjson-cmd
``
### Usage
__`package.json`__
```json
{
"name": "my-cli-util",
"version": "0.5.7",
"main": "./index.js",
"bin": {
"my-cli-util": "./bin/my-cli-util"
},
"dependencies": {
"vnjson-cmd": "^0.1.1"
}
}
+my-cli-util
+node_modules
+bin
-my-cli-util
-index.js
-package.json
my-cli-util
#!/usr/bin/env node
const pkg = require('../package');
process.title = `${pkg.name}@${pkg.version}`;
const
index = require('../index'),
vnjs = require('vnjson-cmd');
vnjs.on('build', function(options){
console.log('Собрать', options);
});
vnjs.on('init', function(options){
index("init", options);
})
vnjs.on('start', function(options){
index("start", options.p);
})
vnjs.on('help', function(){
console.log('--help');
});
vnjs.parse();
License
MIT license (MIT)