Skip to content

Latest commit

 

History

History
47 lines (40 loc) · 1.12 KB

readme.md

File metadata and controls

47 lines (40 loc) · 1.12 KB

Minimist2

Build Status NPM Status

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

  1. Checkout the code
    git clone [email protected]:berdon/minimist2.git
    npm install
  2. Develop
  3. Run tests
    npm test
  4. Submit a pull request

Using

var argv = require('minimist2')(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' }