minimal-args
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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.' }

Dependents (0)

Package Sidebar

Install

npm i minimal-args

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

5.41 kB

Total Files

5

Last publish

Collaborators

  • croxy