Skip to content

Commit 7c37f62

Browse files
committed
release 2.0.0
1 parent 840747a commit 7c37f62

16 files changed

+1261
-497
lines changed

CHANGELOG.md

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
11
# Changelog
22

3-
## 1.1.0 (2025-07-04)
3+
## 2.0.0 (20225-07-08)
4+
5+
- feat(BREAKING CHANGE): optimized structure of return object with parsed elements\
6+
Example: `cli --verbose file.txt -- one two`\
7+
Return:\
8+
**Old v1.x**:
9+
```json5
10+
{
11+
verbose: true,
12+
_: ['file.txt', 'one', 'two'],
13+
}
14+
```
15+
**New v2.x**:
16+
```json5
17+
{
18+
args: {},
19+
flags: { verbose: true },
20+
_: ['file.txt'],
21+
_tail: ['one', 'two'],
22+
}
23+
```
24+
- feat: added `args` option for named positional arguments
25+
- feat: added support for variadic arguments (e.g. `...files`) to collect last arguments into array
26+
- feat: added `boolean` option to treat flags as booleans without consuming values
27+
- feat: return property `_` now contains only positional arguments before `--`
28+
- feat: added return property `_tail` to capture all arguments after `--`
29+
- refactor: removed internal helpers and flattened implementation to keep compact code
30+
- test: added tests for named positional arguments
31+
- docs: improved README, added usage examples
32+
33+
## 1.1.0 (2025-07-04) First stable release
434

5-
- first stable release
635
- feat: rename options for compatibility to yargs-parser options
736
- feat: optimize npm package for smaller size: 12kB -> ~5kB
837
- feat: add d.ts file
@@ -13,10 +42,23 @@
1342

1443
## 1.0.0 (2025-07-04) UNPUBLISHED as not ready for release
1544

16-
## 0.0.2 (2025-07-02)
45+
### Features:
46+
47+
- Short boolean flag: `-f`
48+
- Short flag with value: `-f value`
49+
- Grouped short flags: `-xyz` (equivalent to `-x` `-y` `-z`)
50+
- Long boolean flag: `--flag`
51+
- Long flag with value: `--flag=value` or `--flag value`
52+
- Dashed long flag: `--foo-bar` (available as `flags['foo-bar']` and `flags.fooBar`)
53+
- Multi-values: `--keys foo bar`
54+
- Short-to-long alias: `-f` = `--files`
55+
- Default values for flags
56+
57+
58+
## 0.0.2 (2025-07-02) experimental working version
1759

1860
- fix: resolving files in package.json for CommonJS
1961

20-
## 0.0.1 (2025-07-01) UNPUBLISHED as experimental not working version
62+
## 0.0.1 (2025-07-01) UNPUBLISHED as not working experimental version
2163

2264
- chore(experimental): create small and fast CLI flag parser as lightweight alternative to yargs-parser

0 commit comments

Comments
 (0)