1.0.4 • Published 5 years ago

gar v1.0.4

Weekly downloads
36,726
License
MIT
Repository
github
Last release
5 years ago

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:

PackageSize
optimistoptimist package size
minimistminimist package size
args-parserargs-parser package size
gargar package size