You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
595 B
16 lines
595 B
3 years ago
|
# microargs  [](https://travis-ci.org/pawelgalazka/microargs) [](https://badge.fury.io/js/microargs)
|
||
|
CLI arguments micro parser. Only 25 lines of code, no dependencies.
|
||
|
|
||
|
``` js
|
||
|
#!/usr/bin/env node
|
||
|
const args = require('microargs')(process.argv.slice(1));
|
||
|
console.dir(args);
|
||
|
```
|
||
|
|
||
|
```
|
||
|
$ script.js -a --foo=bar --boo abc def
|
||
|
{
|
||
|
params: ['abc', 'def'],
|
||
|
options: { a: true, foo: 'bar', boo: true }
|
||
|
}
|