args-tokens 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/parse.js +2 -0
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +2 -0
- package/lib/esm/parse.js +2 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## 🐱 Motivation
|
|
10
10
|
|
|
11
|
-
- Although Node.js
|
|
11
|
+
- Although Node.js [`parseArgs`](https://nodejs.org/api/util.html#utilparseargsconfig) can return tokens, that the short options are not in the format I expect. Of course, I recoginize the background of [this issue](https://github.com/pkgjs/parseargs/issues/78).
|
|
12
12
|
- `parseArgs` gives the command line args parser a useful util, so the resolution of the options values and the parsing of the tokens are tightly coupled. As a result, Performance is sacrificed. Of course, I recoginize that's the trade-off.
|
|
13
13
|
|
|
14
14
|
## ⏱️ Benchmark
|
|
@@ -167,7 +167,7 @@ const tokens = parseArgs(['--foo', 'bar', '-x', '--bar=baz'])
|
|
|
167
167
|
console.log('tokens:', tokens)
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
-
## Resolve args
|
|
170
|
+
## Resolve args values with tokens and arg option schema
|
|
171
171
|
|
|
172
172
|
`resolveArgs` is a useful function when you want to resolve values from the tokens obtained by `parseArgs`.
|
|
173
173
|
|
|
@@ -281,7 +281,7 @@ If you are interested in contributing to `args-tokens`, I highly recommend check
|
|
|
281
281
|
|
|
282
282
|
This project is inspired by:
|
|
283
283
|
|
|
284
|
-
- [`
|
|
284
|
+
- [`util.parseArgs`](https://nodejs.org/api/util.html#utilparseargsconfig), created by Node.js contributors and [OpenJS Foundation](https://openjsf.org/)
|
|
285
285
|
- [`pkgjs/parseargs`](https://github.com/pkgjs/parseargs), created by Node.js CLI package maintainers and Node.js community.
|
|
286
286
|
|
|
287
287
|
## ©️ License
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export { parseArgs } from './parser.js';
|
|
|
3
3
|
export { resolveArgs } from './resolver.js';
|
|
4
4
|
export type { ParsedArgs, ParseOptions } from './parse';
|
|
5
5
|
export type { ArgToken, ParserOptions } from './parser';
|
|
6
|
-
export type { ArgOptionSchema } from './resolver';
|
|
6
|
+
export type { ArgOptions, ArgOptionSchema, ArgValues } from './resolver';
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Modifier: kazuya kawaguchi (a.k.a. kazupon)
|
|
2
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
5
|
exports.resolveArgs = exports.parseArgs = exports.parse = void 0;
|
|
4
6
|
var parse_js_1 = require("./parse.js");
|
package/lib/cjs/parse.js
CHANGED
package/lib/esm/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export { parseArgs } from './parser.js';
|
|
|
3
3
|
export { resolveArgs } from './resolver.js';
|
|
4
4
|
export type { ParsedArgs, ParseOptions } from './parse';
|
|
5
5
|
export type { ArgToken, ParserOptions } from './parser';
|
|
6
|
-
export type { ArgOptionSchema } from './resolver';
|
|
6
|
+
export type { ArgOptions, ArgOptionSchema, ArgValues } from './resolver';
|
package/lib/esm/index.js
CHANGED
package/lib/esm/parse.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "args-tokens",
|
|
3
3
|
"description": "parseArgs tokens compatibility and more high-performance parser",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
7
7
|
"email": "kawakazu80@gmail.com"
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"@eslint/markdown": "^6.2.2",
|
|
71
71
|
"@kazupon/eslint-config": "^0.19.0",
|
|
72
72
|
"@kazupon/prettier-config": "^0.1.1",
|
|
73
|
-
"@types/node": "^22.13.
|
|
74
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
75
|
-
"bumpp": "^10.0.
|
|
76
|
-
"eslint": "^9.20.
|
|
73
|
+
"@types/node": "^22.13.4",
|
|
74
|
+
"@vitest/eslint-plugin": "^1.1.31",
|
|
75
|
+
"bumpp": "^10.0.3",
|
|
76
|
+
"eslint": "^9.20.1",
|
|
77
77
|
"eslint-config-prettier": "^10.0.1",
|
|
78
78
|
"eslint-plugin-jsonc": "^2.19.1",
|
|
79
79
|
"eslint-plugin-promise": "^7.2.1",
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
"eslint-plugin-yml": "^1.16.0",
|
|
83
83
|
"gh-changelogen": "^0.2.8",
|
|
84
84
|
"jsr": "^0.13.3",
|
|
85
|
-
"knip": "^5.44.
|
|
85
|
+
"knip": "^5.44.1",
|
|
86
86
|
"lint-staged": "^15.4.3",
|
|
87
87
|
"mitata": "^1.0.34",
|
|
88
88
|
"pkg-pr-new": "^0.0.39",
|
|
89
|
-
"prettier": "^3.5.
|
|
89
|
+
"prettier": "^3.5.1",
|
|
90
90
|
"typescript": "^5.7.3",
|
|
91
91
|
"typescript-eslint": "^8.24.0",
|
|
92
92
|
"vitest": "^3.0.5"
|