1.3.2 • Published 2 years ago

argv-user-input v1.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

NPM version Package size Dependencies devDependencies Status code style: prettier


Content

Features ✨

  • Parse, split commands and options entry by user.
  • Return simple object.

Install 🐙

npm i argv-user-input

Usage 💡

#!/usr/bin/env node
import parseArgvData from 'argv-user-input';
const argvs = parseArgvData();

foo.js

With no commands or options.

$ foo.js 
console.log(argvs);
/*
{
  commands: [],
  options: {},
}
*/

With commands and no option.

$ foo.js start test
console.log(argvs);
/*
{
  commands: ['start', 'test'],
  options: {},
}
*/

With commands and options.

$ foo.js start test --skip -p ./dev
console.log(argvs);
/*
{
  commands: ['start', 'test'],
  options: {
    skip: true,
    p: './dev'
  },
}
*/

With option and no command.

$ foo.js --name=foo
console.log(argvs);
/*
{
  commands: [],
  options: {
    name: 'foo'
  },
}
*/

Contributing 🍰

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!

Maintainers 👷

List of maintainers, replace all href, src attributes by your maintainers datas.

License ⚖️

@MIT