Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arguably

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arguably

Command line arguments parser

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

arguably

Command line arguments parser for node.js

Usage

Let's say you have a script args.js, and call it with

    node args.js -u google.com --name bob

or

    node args.js --url yahoo.com --name bill

And want to simply print the given url and name. Your script should use arguably like this:

    var arguably = require('arguably'),
        args     = arguably
                        .option(
                            '-n, --name',
                            /* description */ 'Your name',
                            /* default value */ 'unknown'
                        )
                        .option('-u, --url')
                        .done() //don't forget to call this at the end

    console.log(args.name)
    args.name === args.n

    console.log(args.url)
    args.url === args.u

Notice that the args variable returned by arguably is an object with key/value pairs, as specified in the option description. On options with multiple aliases. like the url (-u or --url), the args has the save value for both of the aliases


    args.u === args.url

Keywords

FAQs

Package last updated on 06 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc