0.0.1 • Published 4 years ago

minimal-args v0.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

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