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

    noptdpublic

    noptd

    Build Status Coverage Status

    nopt with default values

    Note: noptd is only supported on iojs and node v4+. To use with an older version of node, please use noptd@1.

    Install

    $ npm install --save noptd

    Example

    // test.js 
    var nopt = require('noptd')
    var shortHand = { help: Boolean, name: String }
    var defaults = { name: 'evan' }
    var parsed = nopt(shortHand, null)(defaults)
    console.log(parsed.name)

    Then run with node

    $ node test.js
    // => 'evan'

    Or try passing in a name

    $ node test --name test
    // => 'test'

    Author

    Evan Lucas

    License

    MIT (See LICENSE for more info)

    Keywords

    none

    install

    npm i noptd

    Downloadslast 7 days

    642

    version

    2.0.1

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar
    • avatar