reargv 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +43 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -8,11 +8,52 @@ Reads command-line arguments and returns a structured, representative object.
8
8
  ## Installation
9
9
 
10
10
  ```bash
11
- npm install reargv
11
+ $ npm install reargv
12
12
  ```
13
13
 
14
14
  ## Usage
15
15
 
16
+ ### Script pipeline
17
+
18
+ First, create a script file somewhere
19
+
20
+ ```js
21
+ //argv.mjs
22
+
23
+ import { reargv } from "reargv";
24
+
25
+ console.log(JSON.stringify(reargv(), null, 2))
26
+ ```
27
+
28
+ Then, run it and pass it commands
29
+
30
+ ```bash
31
+ $ node ./argv.mjs hello --world reargv on.npm --and='this is great!' help VERSION -k8 -x > output.json
32
+ ```
33
+
34
+
35
+ ### Output
36
+ (`(...) > output.json` to output in `output.json`)
37
+
38
+ ```js
39
+ {
40
+ options: {
41
+ world: 'reargv',
42
+ and: '"this is great!"',
43
+ help: true,
44
+ version: true,
45
+ k: '8',
46
+ x: true
47
+ },
48
+ files: [ 'on.npm' ],
49
+ misc: [ 'hello' ]
50
+ }
51
+ ```
52
+
53
+ ---
54
+
55
+ ### Mocking process.argv
56
+
16
57
  ```js
17
58
  import { reargv } from "reargv";
18
59
 
@@ -75,4 +116,4 @@ console.log(argv);
75
116
 
76
117
  ## License
77
118
 
78
- [MIT © 2025](https://github.com/ManuUseGitHub/reargv?tab=MIT-1-ov-file#readme)
119
+ [MIT](https://github.com/ManuUseGitHub/reargv?tab=MIT-1-ov-file#readme)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reargv",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Reads command arguments and gives a representative object of them",
5
5
  "main": "index.mjs",
6
6
  "scripts": {
@@ -12,4 +12,4 @@
12
12
  "devDependencies": {
13
13
  "jest": "^30.2.0"
14
14
  }
15
- }
15
+ }