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

yaclip

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaclip

Yet another command line parser (that supports subcommands)

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Yet another command line parser. This one supports subcommands though.

Usage

const parseCommandLine = require("yaclip");

const subcommands = [
    { name: 'subcommand', alias: "s", type: String, multiple: false},
]

const commands = [
    { name: 'command', alias: "c", type: String, multiple: false, subcommands},
    { name: 'other', alias: "0", type: String, multiple: false}
];

const arguments = parseCommandLine(commands);
console.log(arguments);
node example.js \
    --command "This is the command" \
    --subcommand "this goes in the subsection of command" \
    --other "this is parsed nicely"

It has limitations, I built it for bounce.

Dash optionality

If you prefer your commands without dashes, specify option dashesAreOptional to true when instantiating the parser:

const arguments = parseCommandLine(commands, { dashesAreOptional: true });
console.log(arguments);
node example.js \
    command "This is the command" \
    --subcommand "this goes in the subsection of command" \
    other "this is parsed nicely"

Keywords

FAQs

Package last updated on 26 May 2020

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