micro-ap
![License](https://badgen.net/github/license/sovrin/micro-ap)
tiny arg parser
Installation
$ npm i micro-ap
About
micro-a is a small and opinionated argument parser library without any additional dependencies.
Functions
flag(flag, name, fallback = false)
Extract flag arguments
flag
(string); one char as flag e.g. -f
name
(string); full name of a flag e.g. --file
fallback
(string); default value
command(name, fallback = false)
Extract command arguments
name
(string); name of the command e.g. install
fallback
(string); default value
get()
Returns the parsed arguments as an object
Examples
const parser = require('micro-ap');
parser(process.argv)
.flag('v', 'verbose')
.command('install')
.get()
;
parser(process.argv)
.command('install')
.flag('f', 'file')
.flag('o', 'output')
.flag('v', 'verbose', true)
.get()
;
Licence
MIT License, see LICENSE