n-argv

1.0.0 • Public • Published

n-argv

node cli argv parser

Getting started:

const argv = require("n-argv");

get

argv.get(argName) argName - string return - string

node app.js --param value1 --param2 value2
var arg = argv.get('param');
console.log(arg) // 'value1'

contains

argv.contains(tableOfArgs) tableOfArgs - table return - boolean

node app.js --param value1 --param2 value2
argv.contains(['param2']); //return true
argv.contains(['param','param3']); //return false

setPrefix

argv.setPrefix(argPrefix) argPrefix - string

node app.js --param value1 --param2 value2 -param3 value3
argv.setPrefix('-']);
argv.get('param'); //return null
argv.get('param3'); //return value3

Readme

Keywords

Package Sidebar

Install

npm i n-argv

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • glokam