Awesome
minimist-plugins
Simple wrapper to make minimist pluggable. ~20 sloc.
Install
Install with npm
$ npm i minimist-plugins --save
Usage
var minimist = require('minimist');
var plugins = require('minimist-plugins');
var cli = plugins(mimimist)
.use(require('plugin-one'))
.use(require('plugin-two'));
// '$ --set=a:b'
cli.parse(process.argv.slice(2), function (err, res) {
//=> {_: [], set: {a: 'b'}}
});
Creating plugins
The following is the most basic plugin.
function plugin(cli) {
// `minimist-plugins` instance
return function (argv, next) {
// parsed arguments
next(null, argv);
};
}
Related projects
- minimist: parse argument options
- minimist-events: Add events to minimist, ~30 sloc.
- minimist-expand: Expand minimist args with expand-object.
- minimist-methods: Map your node.js application's methods to command line arguments.
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
License
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on August 15, 2015.