args-and-flags

    2.3.0 • Public • Published

    args-and-flags

    An argument parser based on minimist that offers named arguments, flags, validation, and default or required values.

    npm travis standard conduct

    Install

    npm install --save args-and-flags

    Node v8 and higher is required

    Usage

    const ArgsAndFlags = require('args-and-flags')
     
    const options = {
      args: [
        {
          name: 'hello',
          type: 'string',
          help: 'an argument for saying hello'
        }
      ],
      flags: [
        {
          name: 'message',
          alias: 'm',
          type: 'boolean',
          help: 'a boolean argument'
        }
      ]
    }
     
    const parser = new ArgsAndFlags(options)
    const { args, flags } = parser.parse(['hi', '-m'])

    Documentation

    Examples

    Contributing

    Contributions are welcome! Please read the contributing guidelines first.

    Conduct

    Help keep this project open and inclusive. Read and follow our Code of Conduct.

    Change log

    Read about the changes to this project in CHANGELOG.md. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

    Contact

    License

    ISC

    Install

    npm i args-and-flags

    DownloadsWeekly Downloads

    8

    Version

    2.3.0

    License

    ISC

    Unpacked Size

    27.4 kB

    Total Files

    13

    Last publish

    Collaborators

    • sethvincent