New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

st-cl-parser

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

st-cl-parser

Module to parse command line arguments.

latest
Source
npmnpm
Version
0.6.0
Version published
Maintainers
1
Created
Source

st-cl-parser

Overview

Utility to parser command line arguments in a simple but effective way. This module has no external dependencies and was build to be straight forward with no extra frills.

Install

Using npm with git npm install --save-dev st-cl-parser

Types of Arguments

  • values - node index.js --srcDir='./src/' argument with label that provides a value to be passed through
  • boolean - node index.js --debug argument parameters but provides to value (If excluded value is false/undefined. If passed in argv, then value is true.)
  • flags - node index.js -a -bc a,b,c would all be considered flags (single letter and single hypen)
  • attributes - node index.js release 'release' would be considered an attribute in this case. I like to think of them as commands. (multiple can be passed)

Usage

var parseArgs = require('st-cl-parser');
var args = parseArgs(process.argv);
console.log(args);
{
    srcDir: './src/',
    debug: true,
    attrs: [
        'release'
    ],
    flags: [
        'a',
        'b'
    ]
}

Examples

  • node ./test.js --debug release -ab -a -edc --config=./config.js
var options = parseArgs();
console.log(options);
{
  executor: '/Users/mstark5652/.nvm/versions/node/v12.13.1/bin/node',
  script: '/Users/mstark5652/dev/js/st-cl-parser/test.js',
  flags: [ 'a', 'b', 'e', 'd', 'c' ],
  attrs: [ 'release' ],
  debug: true,
  config: './config.js'
}

License

MIT License - See LICENSE.md

FAQs

Package last updated on 28 Jun 2021

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