- chore: improve performance
- chore: reduce unpacked package size
- feat: add support negated flags with prefix
--no-, e.g.--no-color->{ color: false } - feat: add support both CommonJS and ESM
- feat: add support TypeScript
- feat: add support TSC, compatible with
module: "Node16" - feat: reduce unpacked package size
- feat(BREAKING CHANGE): optimized structure of return object with parsed elements
Example:cli --verbose file.txt -- one two
Return:
Old v1.x:New v2.x:{ verbose: true, _: ['file.txt', 'one', 'two'], }
{ args: {}, flags: { verbose: true }, _: ['file.txt'], _tail: ['one', 'two'], }
- feat: added
argsoption for named positional arguments - feat: added support for variadic arguments (e.g.
...files) to collect last arguments into array - feat: added
booleanoption to treat flags as booleans without consuming values - feat: return property
_now contains only positional arguments before-- - feat: added return property
_tailto capture all arguments after-- - refactor: removed internal helpers and flattened implementation to keep compact code
- test: added tests for named positional arguments
- docs: improved README, added usage examples
- feat: rename options for compatibility to yargs-parser options
- feat: optimize npm package for smaller size: 12kB -> ~5kB
- feat: add d.ts file
- refactor: refactor code, add more comments
- chore: add rollup to build clean npm package
- test: add CI workflow via GitHub actions
- docs: improve readme
- Short boolean flag:
-f - Short flag with value:
-f value - Grouped short flags:
-xyz(equivalent to-x-y-z) - Long boolean flag:
--flag - Long flag with value:
--flag=valueor--flag value - Dashed long flag:
--foo-bar(available asflags['foo-bar']andflags.fooBar) - Multi-values:
--keys foo bar - Short-to-long alias:
-f=--files - Default values for flags
- fix: resolving files in package.json for CommonJS
- chore(experimental): create small and fast CLI flag parser as lightweight alternative to yargs-parser