The argv-utils
package is a lightweight library for Node.js that simplifies working with command-line arguments passed to your scripts. It streamlines the process of accessing and managing arguments from process.argv
property.
Install the package:
$ npm install -D argv-utils
Manage your arguments with ease:
$ node my-script.js --one --two="Hello World!" --someValue="false"
// my-script.js
import { argv } from 'node:process';
import { parseArgs } from 'argv-utils';
parseArgs(argv);
// {
// execPath: '/usr/local/bin/node',
// scriptPath: '/path/to/my-script.js',
// one: 'true',
// two: 'Hello World!',
// someValue: 'false',
// }
- JavaScript / TypeScript
$ npm run test:unit
- ...
- [ ] ...
Install dependencies:
$ npm install
Build the library:
$ npm start
Publish to npm
:
$ npm publish