CityBEM-CityLayers-SaeedRay.../node_modules/gar
2024-11-05 15:01:14 -05:00
..
index.js This commit pushes the node_modules folder separately due to its large size. 2024-11-05 15:01:14 -05:00
LICENSE This commit pushes the node_modules folder separately due to its large size. 2024-11-05 15:01:14 -05:00
package.json This commit pushes the node_modules folder separately due to its large size. 2024-11-05 15:01:14 -05:00
README.md This commit pushes the node_modules folder separately due to its large size. 2024-11-05 15:01:14 -05:00

gar

The lightweight Node arguments parser

GitHub | NPM

Install

npm i gar

Use

gar usage demo

const args = require('gar')(process.argv.slice(2))

console.log(args)

So for: -h hey --toggle -ac --hey=hi -spaced "hey there" -num 1 lone

{
	"h": "hey",
	"toggle": true,
	"a": true,
	"c": true,
	"hey": "hi",
	"spaced": "hey there",
	"num": 1,
	"_": ["lone"]
}

Why use gar?

gar is way more lightweight than other argument parsing packages.

Here's a size comparison table:

Package Size
optimist optimist package size
minimist minimist package size
args-parser args-parser package size
gar gar package size