Socket
Socket
Sign inDemoInstall

minimal-args

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    minimal-args

A minimal argument parser.


Version published
Weekly downloads
2
Maintainers
1
Install size
5.96 kB
Created
Weekly downloads
 

Readme

Source

minimal-args

A simple argument module.

const args = require("minimal-args");

//You can change the arguments prefix. Default: -
args.prefix("-");

//Normal argument.
var content = "-first=first argument. -second=second argument."
console.log(content)
//Result: { first: 'first argument.', second: 'second argument.' }

//Arguments inside brackets.
args.inBrackets(true)

var content = "-first(first argument.) -second(second argument.)"
console.log(content)
//Result: { first: 'first argument.', second: 'second argument.' }

//Also, you can write arguments inside the quotes. 
//Example;
var content = "-first='first argument.' -second='second argument.'"
console.log(content)
//Result: { first: 'first argument.', second: 'second argument.' }

//or write every argument in new line
var content = `

-first='first argument.' 
-second='second argument.'

`
console.log(content)
//Result: { first: 'first argument.', second: 'second argument.' }

Keywords

FAQs

Last updated on 21 Oct 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc