You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@hugoalh/cli-argument-parser

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@hugoalh/cli-argument-parser

A library/module and CLI to parse CLI argument with hugoalh standard.

0.1.0
unpublished
pre
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

[NodeJS] CLI Argument Parser

hugoalh-studio/NodeJS.CLIArgumentParser GitHub Language Count GitHub Top Langauge GitHub Repo Size GitHub Code Size GitHub Watcher GitHub Star GitHub Fork

A NodeJS library/module and CLI to parse CLI argument with hugoalh standard.

LicenseMIT
Release Latest: ()
Pre: ()
Release (NPM) Latest:
Pre:
Contributor
Issue :
Pull Request :
Code Quality CodeFactor Grade LGTM Alert LGTM Grade

📜 Description

🌟 Feature

  • Easier to remember which is flag and which is key-value pair.
  • Native support for CommonJS and ECMAScript.

📄 Documentation

For the official documentation, please visit GitHub Repository Wiki.

Getting Started (Excerpt)

For Library/Module

NodeJS (>= v10.13) & NPM (>= v6.4.1):

> npm install @hugoalh/cli-argument-parser

For CLI

NodeJS (>= v10.13) & NPM (>= v6.4.1):

# Use either one
> npm install -g @hugoalh/cli-argument-parser
> npm install --global @hugoalh/cli-argument-parser

API (Excerpt)

parse(cliArgument?)

CLI (Excerpt)

...[cli-argument]

Example

const cliArgumentParser = require("@hugoalh/cli-argument-parser");

console.log(cliArgumentParser.parse(["-test", "--message:=\"Hello, world!\"", "lol", "---fail"]));
/*
{
  flag: ["test"],
  line: ["lol"],
  pair: {
    message: "Hello, world!"
  },
  unparseable: ["---fail"]
}
*/
> cli-argument-parser -test --message:="Hello, world!" lol ---fail
{
  flag: ["test"],
  line: ["lol"],
  pair: {
    message: "Hello, world!"
  },
  unparseable: ["---fail"]
}

Keywords

nodejs

FAQs

Package last updated on 09 Nov 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