env-detector 1.0.0 → 1.0.1
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 +83 -10
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -1,25 +1,98 @@
|
|
|
1
|
-
# env-
|
|
1
|
+
# env-detector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Smart environment variable analyzer and .env generator.
|
|
4
|
+
|
|
5
|
+
Automatically detects `process.env` usage, generates `.env`, groups environments, detects missing variables, and audits configuration.
|
|
6
|
+
|
|
7
|
+
---
|
|
4
8
|
|
|
5
9
|
## Install
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
Run directly:
|
|
12
|
+
|
|
13
|
+
npx env-detector
|
|
14
|
+
|
|
15
|
+
OR install globally:
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
npm install -g env-detector
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
---
|
|
12
20
|
|
|
13
21
|
## Usage
|
|
14
22
|
|
|
15
|
-
env-
|
|
23
|
+
env-detector
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
|
|
29
|
+
Generate .env
|
|
30
|
+
env-detector
|
|
31
|
+
|
|
32
|
+
Compare env usage
|
|
33
|
+
env-detector --compare
|
|
34
|
+
|
|
35
|
+
Check missing variables
|
|
36
|
+
env-detector --check
|
|
37
|
+
|
|
38
|
+
Fix unused variables
|
|
39
|
+
env-detector --fix
|
|
40
|
+
|
|
41
|
+
Security scan
|
|
42
|
+
env-detector --security
|
|
43
|
+
|
|
44
|
+
Strict mode (CI)
|
|
45
|
+
env-detector --strict
|
|
46
|
+
|
|
47
|
+
Interactive fill
|
|
48
|
+
env-detector --ask
|
|
49
|
+
|
|
50
|
+
---
|
|
16
51
|
|
|
17
52
|
## Example
|
|
18
53
|
|
|
19
|
-
|
|
20
|
-
|
|
54
|
+
Code:
|
|
55
|
+
|
|
56
|
+
process.env.DB_HOST
|
|
57
|
+
process.env.PORT
|
|
58
|
+
|
|
59
|
+
Generated `.env`
|
|
60
|
+
|
|
61
|
+
DB_HOST=
|
|
62
|
+
PORT=
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Grouped Config Support
|
|
67
|
+
|
|
68
|
+
If config file contains:
|
|
69
|
+
|
|
70
|
+
development: {
|
|
71
|
+
username: process.env.DBUSERNAME
|
|
72
|
+
}
|
|
21
73
|
|
|
22
74
|
Generated:
|
|
23
75
|
|
|
24
|
-
|
|
25
|
-
|
|
76
|
+
# development
|
|
77
|
+
DBUSERNAME=
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Features
|
|
82
|
+
|
|
83
|
+
- Detect process.env usage
|
|
84
|
+
- Auto generate .env
|
|
85
|
+
- Detect missing variables
|
|
86
|
+
- Detect unused variables
|
|
87
|
+
- Detect empty values
|
|
88
|
+
- Extract fallback defaults
|
|
89
|
+
- Group by environment
|
|
90
|
+
- Security scan
|
|
91
|
+
- CI strict mode
|
|
92
|
+
- Auto fix unused
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "env-detector",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Smart .env generator and auditor",
|
|
5
5
|
"main": "src/scan.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"env-detector": "./bin/env-scan.js"
|
|
8
|
-
"env-scan": "./bin/env-scan.js"
|
|
7
|
+
"env-detector": "./bin/env-scan.js"
|
|
9
8
|
},
|
|
10
9
|
"scripts": {
|
|
11
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|