cli-argument-helper
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

cli-argument-helper

Functions to help you deal with parameters in your command-line application.

Installation

yarn add cli-argument-helper

Usage

const args = ["--a", "1", "--b", "2", "--user-id", "3", "--c", "X"];
expect(getNamedArgument(args, "--user-id", getInteger)).to.be.equal(3);
expect(getNamedArgument(args, "--b", getInteger)).to.be.equal(2);
expect(getNamedArgument(args, "--a", getInteger)).to.be.equal(1);
expect(getNamedArgument(args, "--c", getString)).to.be.equal("X");
expect(args).to.be.deep.equal([]);

Readme

Keywords

none

Package Sidebar

Install

npm i cli-argument-helper

Weekly Downloads

7

Version

0.0.8

License

MIT

Unpacked Size

3.69 kB

Total Files

4

Last publish

Collaborators

  • vqueiroz
  • victorqueiroz1