Skip to content
forked from dimsmol/args

Command line arguments parser for node.js

Notifications You must be signed in to change notification settings

thomasdavis/args

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

args

args is command line arguments parser for node.js

Instead of trying to deal with all your complex cases, args provides a toolset to help you with arguments parsing.

features

Supported syntax for options: --option=value, --option value, -abc, -abc value

For boolean flags, true value can be omitted, i.g. -f true can be replaced with -f (and --flag true with --flag also).

option properties

  • name
  • shortName
  • key
  • type
  • isList
  • enumItems
  • enumHelp
  • required
  • defaultValue
  • help

usage example

var args = require('args');

var options = args.Options.parse([
	{
		name: 'option',
		shortName: 'o',
		type: 'int',
		help: 'some option'
	}
]);

options.getHelp();

var parser = new args.Parser('node app.js --option 11'.split(' '), 2);
parser.parse(options);
var parsed = parser.prepareResult();
console.log(parsed); // {option: 11}

About

Command line arguments parser for node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages