$ yarn add @stlib/argv
Important
Node.js 18.x+ version must be installed in your OS.
Object type for arguments
OptionsType {
[key: string]: string;
}
// Parses arhuments and return object
function parseArgs(argv: string[]): OptionsType;
// Object with parsed arguments
const options: OptionsType;
Example
$ yarn ts-node index.ts -a --b -c=1 --d= 2 --e=smth=3 -f 4
import { options } from '@stlib/argv';
console.log(options);
// Output: { a: true, b: true, c: '1', d: '2', e: 'smth=3', f: '4' }
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Project changes are writen in changelog, see the CHANGELOG.md.
We use SemVer for versioning. For the versions available, see the tags on this repository. For the versions supported, see the SECURITY.md.
This project is licensed under the MIT License - see the LICENSE.md