New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

named-argv

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

named-argv

a simple node module that helps passing named arguments

0.3.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

node-named-argv

A simple node.js module that helps adding named parameters to a node app call

Installing

npm install named-argv

Usage

You may use both '--' and '-' prefixes for your named parameters:

node myapp.js --opt1=value1 -opt2=value

You may also pass unnamed parameters:

node myapp.js unnamed1 unnamed2

In your code:

var argv = require('named-argv');
console.log(argv.opts); // opts object contains all named parameters 
console.log(argv.params); // array, contains all unnamed parameters

Passing arrays to arguments? Yes, it's possible:

node myapp.js --optarr=val1 --optarr=val2 --optarr=val3

Keywords

arguments

FAQs

Package last updated on 09 Jan 2015

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