mirror of
https://github.com/Wessel/larg.git
synced 2026-06-05 23:15:43 +02:00
08029c5694a17ba672fe913ff5d4b9336594d128
larg
A lightweight Node.js argument parser which can be used in various ways.
Installing
$ yarn add larg # Install w/ Yarn (the superior package manager)
$ npm i larg # Install w/ NPM
Usage
Code
const argv = require( 'larg' )( process.argv.slice( 2 ) );
console.log( argv );
Result
$ node test.js -x 3 -y 4 -ab --beep=boop foo bar
{ _: [ 'foo', 'bar' ],
x: 3,
y: 4,
a: true,
b: true,
beep: 'boop' }
Why should I use larg?
Larg is very lightweight (3.45kb total) comparing to other packages such as optimist and minimist.
Languages
JavaScript
100%