Socket
Book a DemoInstallSign in
Socket

nano-args

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nano-args

Process arguments parsing helper function

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Gitter NPM version Dependency Status License Downloads

nano-args

Process arguments parsing helper function

API

args(help_text, arguments_names, options)

  • help_text String
  • arguments_names Array
    • identifier of argument
  • options Array of Array 0. Short option name
    • long option name and 'type'
    • option description

There is more details about options format in docs for node-getopt.

Example

var args = require('nano-args');

args = args("\
Usage: node util.js [OPTIONS] <profile> [<theme>]\n\
profile  - a device profile name or comma separated(without spaces) list of profiles names.\n\
           There's two shortcuts: 'all' and 'tests'. 'all' means all profiles. 'tests' means run\n\
           all tests.\n\
Options:\n\
[[OPTIONS]]\n", [ 'profile', 'theme' ], [
		[ 'f', 'folder=',    'logs folder path. default value is "'+logs_folder+'"' ],
		[ 'F', 'features=',  'features space separated modifiers list like "feat -nopack +web_bridges"' ],
		[ 'C', 'components=','components space separated modifiers list like "acl -usb +pptp"' ],
		[ 'n', 'ndwrt=',     'ndrwt folder path. default value is "'+ndwrt+'"'],
		[ 's', 'server',     'run localhost web server with built web-interface'],
		[ 'd', 'debug',      'enable web server debug prompt'],
		[ 'H', 'host=',      'host for web server ndm requests'],
		[ 'L', 'last=',      'use last run stored arguments'],
		[ 'P', 'preset=',    'build preset. (release, host, ...)'],
		[ 'h', 'help',       'print usage instruction' ]
	]);

console.log(args);

Keywords

args

FAQs

Package last updated on 30 Jan 2016

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.