gar

The lightweight Node arguments parser

  • gar

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
gar
3311.0.45 years ago6 years agoMinified + gzip package size for gar in KB

Readme

gar
The lightweight Node arguments parser
GitHub | NPM

Install

```bash npm i gar ```

Use

gar usage demo ```javascript 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 ```json {
"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