1.0.2 • Published 7 years ago
minimist2 v1.0.2
Minimist2
Minimist2 is a rewrite of the popular Minimist Javascript library for argument parsing. The library aims to be a drop-in replacement with matching API footprint. It passes all original Minimist unit tests.
Minimist2 is written in TypeScript targetting ES6.
Installing
npm install minimist2
Development
- Checkout the code
git clone git@github.com:berdon/minimist2.git npm install
- Develop
- Run tests
npm test
- Submit a pull request
Using
var argv = require('minimist')(process.argv.slice(2));
console.dir(argv);
$ node example/parse.js -a beep -b boop
{ _: [], a: 'beep', b: 'boop' }
$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
{ _: [ 'foo', 'bar', 'baz' ],
x: 3,
y: 4,
n: 5,
a: true,
b: true,
c: true,
beep: 'boop' }