Content
- Parse, split commands and options entry by user.
- Return simple object.
npm i argv-user-input
#!/usr/bin/env node
import parseArgvData from 'argv-user-input';
const argvs = parseArgvData();
foo.js
$ foo.js
console.log(argvs);
/*
{
commands: [],
options: {},
}
*/
$ foo.js start test
console.log(argvs);
/*
{
commands: ['start', 'test'],
options: {},
}
*/
$ foo.js start test --skip -p ./dev
console.log(argvs);
/*
{
commands: ['start', 'test'],
options: {
skip: true,
p: './dev'
},
}
*/
$ foo.js --name=foo
console.log(argvs);
/*
{
commands: [],
options: {
name: 'foo'
},
}
*/
Please make sure to read the Contributing Guide before making a pull request. Thank you to all the people who already contributed to this project!
List of maintainers, replace all href
, src
attributes by your maintainers datas.
Tostee Lucas 💻 |
@MIT