Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

pawelgalazka/cli-args

Repository files navigation

cli-args node version Build Status npm version

CLI arguments micro parser. Only 38 lines of code, no dependencies.

#!/usr/bin/env node
const args = require('@pawelgalazka/cli-args')(process.argv.slice(2));
console.dir(args);
$ script.js -a --foo=bar --boo abc def
{
    params: ['abc', 'def'],
    options: { a: true, foo: 'bar', boo: true }
}