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

menu-args

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

menu-args

Toolkit for creating command line interfaces without writing so much code

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

menu-args

Toolkit for creating command line interfaces without writing so much code.

menu-args uses the args package.

const menu = require('menu-args')

var args = menu(`
Commands
    serve "Run server"
    build
    reload

Options
    user "Username"
    pass "Password system"
    state
    port (8080) "Port, default value"
`)

console.log(args.parse(process.argv))

If the command is executed:

node test.js -u the.user -p 1a2b3c

it is obtained:

/* { P: '8080',
  port: '8080',
  u: 'the.user',
  user: 'the.user',
  p: '1a2b3c',
  pass: '1a2b3c' } */

Note that the variable args is exactly the args package

Install

npm install menu-args --save

Example

If you run function args.showHelp(), we'll see:

Usage: test.js [options] [command]

  Commands:

    build, b
    help      Display help
    reload    undefined
    serve     "Run server"
    version   Display version

  Options:

    -h, --help          Output usage information
    -p, --pass          Password system
    -P, --port [value]  Port, default value (defaults to "8080")
    -s, --state
    -u, --user          "Username"
    -v, --version       Output the version number

License MIT

Keywords

FAQs

Package last updated on 25 Apr 2018

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