extract-from-argv 0.4.6 → 0.4.7

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 +34 -34
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,34 +1,34 @@
1
- # extract-from-argv
2
-
3
- Extracts arguments that were passed when the Node.js process was launched.
4
-
5
- ## Usage
6
-
7
- **Pass arguments to the node process and read it**
8
-
9
- ```node my-script.js --port=4200```
10
- ```ts
11
- const port = extractFromArgv('--port'); // Returns '4200'
12
- ```
13
-
14
- **Custom separator**
15
-
16
- ```node my-script.js --port:4200```
17
- ```ts
18
- const port = extractFromArgv('--port', { valueSeparator: ':' }); // Returns '4200'
19
- ```
20
- **Custom argv object**
21
- ```ts
22
- const port = extractFromArgv('--port', { argv: ['/usr/node', '--port=5000'] }); // Returns '5000'
23
- ```
24
-
25
- **Arguments without values**
26
-
27
- ```node my-script.js --fun-mode```
28
- ```ts
29
- // If an argument without an value is found it returns an empty string
30
- extractFromArgv('--fun-mode'); // Returns ''
31
-
32
- // If a argument was not found the function returns null
33
- extractFromArgv('--angry-mode'); // Returns null'
34
- ```
1
+ # extract-from-argv
2
+
3
+ Extracts arguments that were passed when the Node.js process was launched.
4
+
5
+ ## Usage
6
+
7
+ **Pass arguments to the node process and read it**
8
+
9
+ ```node my-script.js --port=4200```
10
+ ```ts
11
+ const port = extractFromArgv('--port'); // Returns '4200'
12
+ ```
13
+
14
+ **Custom separator**
15
+
16
+ ```node my-script.js --port:4200```
17
+ ```ts
18
+ const port = extractFromArgv('--port', { valueSeparator: ':' }); // Returns '4200'
19
+ ```
20
+ **Custom argv object**
21
+ ```ts
22
+ const port = extractFromArgv('--port', { argv: ['/usr/node', '--port=5000'] }); // Returns '5000'
23
+ ```
24
+
25
+ **Arguments without values**
26
+
27
+ ```node my-script.js --fun-mode```
28
+ ```ts
29
+ // If an argument without an value is found it returns an empty string
30
+ extractFromArgv('--fun-mode'); // Returns ''
31
+
32
+ // If a argument was not found the function returns null
33
+ extractFromArgv('--angry-mode'); // Returns null'
34
+ ```
package/package.json CHANGED
@@ -2,14 +2,14 @@
2
2
  "name": "extract-from-argv",
3
3
  "description": "Extracts arguments that were passed when the Node.js process was launched.",
4
4
  "license": "MIT",
5
- "version": "0.4.6",
5
+ "version": "0.4.7",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/hansireit/angular-lib",
9
9
  "directory": "libs/extract-from-argv"
10
10
  },
11
11
  "dependencies": {
12
- "tslib": "^2.3.0"
12
+ "tslib": "^2.6.2"
13
13
  },
14
14
  "type": "commonjs",
15
15
  "main": "./src/index.js",