Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    aliasespublic

    aliases Build Status

    Parse flag aliases in CLI help output

    Install

    $ npm install aliases
    

    Usage

    const aliases = require('aliases');
     
    const help = `
        Usage
          $ unicorn <name>
     
        Options
          -r, --rainbow  Lorem ipsum dolor sit amet
          -m, --magic    Aenean commodo ligula eget dolor
    `;
     
    aliases(help, {h: 'help'});
    /*
    {
        r: 'rainbow',
        m: 'magic',
        h: 'help'
    }
    */

    The result can be passed directly to the minimist alias option or used in meow with some effort.

    API

    aliases(input, [extras])

    input

    Type: string

    CLI help output.

    extras

    Type: Object

    Extra aliases to mix into the result.

    Related

    License

    MIT © Sindre Sorhus

    install

    npm i aliases

    Downloadslast 7 days

    105

    version

    1.0.0

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar