@jcubic/lily
v0.5.1
Published
Very simple option parser inspired by YARGS with no dependencies
Maintainers
Readme
LILY
LILY is very simple option parser inspired by YARGS with no dependencies
LILY stands for LILY Is Like Yargs
In fact, it's inspired by yargs-parser used by Yargs to parse the options.
Installation
npm install --save @jcubic/lilyUsage
#!/usr/bin/env node
const lily = require('@jcubic/lily');
// or
import lily from '@jcubic/lily';
const options = lily(process.argv.slice(2), { boolean: ['b'] });if you run the script with:
./script -l 10 --hello 20 -asb one two threeyou will get this object as result:
{
"_": [
"one",
"two",
"three"
],
"l": "10",
"hello": "20",
"a": true,
"s": true,
"b": true
}Options
| Option | Description |
| --- | --- |
| boolean | Array of option names treated as boolean flags, so they don't consume the next argument as their value. |
| parse_args | When true, parses values into number, boolean or RegExp where possible; otherwise all values stay string. |
License
Copyright (C) 2020-2026 Jakub T. Jankiewicz
Released under MIT license
