minimal-args

A minimal argument parser.

Usage no npm install needed!

<script type="module">
  import minimalArgs from 'https://cdn.skypack.dev/minimal-args';
</script>

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