JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q42906F
  • License MIT

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cli-argument-helper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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([]);