minimal-args
v0.0.1
Published
A minimal argument parser.
Downloads
1
Maintainers
Readme
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.' }