@deveko/devguard 0.1.7 β†’ 0.1.10

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 CHANGED
@@ -1,177 +1,181 @@
1
- # πŸ›‘οΈ DevGuard
2
-
3
- > Catch broken configs before they break your app.
4
-
5
- DevGuard is a fast, zero-config `.env` scanner for Node.js projects. It validates your environment variables and warns you about weak secrets, invalid ports, malformed URLs, and empty values β€” before you ship.
6
-
7
- Built with Rust. Fast by default.
8
-
9
- ---
10
-
11
- ## ✨ Features
12
-
13
- - πŸ” Scans your `.env` file instantly
14
- - ❌ Detects weak secrets (`SECRET`, `KEY`, `API` too short)
15
- - ❌ Catches invalid port values (e.g. `PORT=abc`)
16
- - ❌ Flags malformed URLs (e.g. `DATABASE_URL=localhost`)
17
- - ❌ Validates `NODE_ENV` values
18
- - ⚠️ Warns about empty, malformed, or missing variables
19
- - βœ… Priority-based rule engine
20
- - βœ… Auto-generates `.env.example` from `.env`
21
- - βœ… Clean, readable CLI output
22
-
23
- ---
24
-
25
- ## πŸš€ Installation
26
-
27
- ```bash
28
- npx @deveko/devguard
29
- ```
30
-
31
- That's it. No installation needed.
32
-
33
- ---
34
-
35
- ## πŸ“¦ Usage
36
-
37
- Place a `.env` file in your project root, then run:
38
-
39
- ```bash
40
- # Scan default .env
41
- npx @deveko/devguard check
42
-
43
- # Scan a custom path
44
- npx @deveko/devguard check --path ./apps/backend/.env
45
-
46
- # Generate .env.example from .env
47
- npx @deveko/devguard init
48
- ```
49
-
50
- ### Example `.env`
51
-
52
- ```env
53
- TEST2
54
- PORT=abc
55
- JWT_SECRET=123
56
- DATABASE_URL=localhost
57
- NODE_ENV=staging
58
- API_KEY=
59
- STRIPE_SECRET_KEY=shortkey
60
- HOST=
61
- CLIENT_ID=
62
-
63
- PORT_HOST_KEY=g
64
- ```
65
-
66
- ### Example output
67
-
68
- ```bash
69
- πŸ” DevGuard - scanning .env...
70
-
71
- ⚠️ 'TEST2' is malformed - missing '='
72
- ❌ HOST -> must not be empty
73
- ❌ PORT_HOST_KEY -> must be greater than or equal to 32
74
- ❌ NODE_ENV -> must be "development" or "production" or "test"
75
- ❌ API_KEY -> must not be empty
76
- ❌ DATABASE_URL -> must start with http://, https://, postgres://, postgresql://, mysql://, redis://, rediss://, mongodb://, mongodb+srv://, amqp://, amqps://, sqlite://
77
- ❌ JWT_SECRET -> must be greater than or equal to 32
78
- ❌ CLIENT_ID -> must not be empty
79
- ❌ STRIPE_SECRET_KEY -> must be greater than or equal to 32
80
- ❌ PORT -> must be a number
81
-
82
- ⚠️ 9 error(s) and 1 warning(s) found
83
- ```
84
-
85
- When everything looks good:
86
-
87
- ```bash
88
- πŸ” DevGuard - scanning .env...
89
-
90
- βœ… All checks passed! Your .env looks good!
91
- ```
92
-
93
- ---
94
-
95
- ## 🧠 How It Works
96
-
97
- DevGuard scans your `.env` file line by line and runs pattern-based validation rules with priority ordering:
98
-
99
- | Pattern | Rule |
100
- | ------- | ---- |
101
- | Key is `NODE_ENV` | Must be `development`, `production`, or `test` |
102
- | Key contains `SECRET` or `KEY` or `API` | Value must be β‰₯ 32 characters |
103
- | Key contains `URL` | Must start with a valid protocol (http, postgres, redis, etc.) |
104
- | Key contains `PORT` | Must be a valid number (0-65535) |
105
- | Key contains `HOST` | Must not be empty |
106
- | Key contains `ID` | Must not be empty |
107
-
108
- Rules are checked in priority order β€” first match wins.
109
- No config needed. Just run it.
110
-
111
- ---
112
-
113
- ## πŸ—ΊοΈ Roadmap
114
-
115
- - [x] `.env` parser
116
- - [x] Pattern-based validation engine
117
- - [x] CLI output with colors
118
- - [x] `npx devguard` via npm
119
- - [x] `--path` option for custom `.env` paths
120
- - [x] Malformed line detection
121
- - [x] Improved error summary
122
- - [x] New validation rules
123
- - [x] Priority system
124
- - [x] `devguard init` -> auto-generate `.env.example`
125
- - [ ] Missing required keys detection
126
- - [ ] Custom rules via `devguard.config.toml`
127
- - [ ] CI/CD integration
128
- - [ ] GitHub Action
129
- - [ ] VSCode extension
130
- - [ ] Docker config validation
131
- - [ ] Secret leak detection in source files
132
-
133
- ---
134
-
135
- ## πŸ”§ Local Development
136
-
137
- ```bash
138
- git clone https://github.com/ekojoecovenant/devguard.git
139
- cd devguard
140
- cargo build --release
141
- node cli.js check
142
- ```
143
-
144
- ---
145
-
146
- ## 🀝 Contributing
147
-
148
- Contributions are welcome! Here's how to get started:
149
-
150
- 1. Fork the repo
151
- 2. Create a feature branch
152
-
153
- ```bash
154
- git checkout -b feature/your-feature-name
155
- ```
156
-
157
- 3. Make your changes
158
- 4. Run the project locally to test
159
-
160
- ```bash
161
- cargo build --release
162
- node cli.js check
163
- ```
164
-
165
- 5. Open a Pull Request with a clear description of what you changed and why
166
-
167
- Please keep PRs focused β€” one feature or fix per PR.
168
-
169
- ---
170
-
171
- ## πŸ“„ License
172
-
173
- MIT β€” use it, build on it, ship it.
174
-
175
- ---
176
-
177
- <p align="center">Built with πŸ¦€ Rust β€” by <a href="https://github.com/ekojoecovenant">ℭ𝔬𝔳𝔒</a></p>
1
+ # πŸ›‘οΈ DevGuard
2
+
3
+ > Catch broken configs before they break your app.
4
+
5
+ DevGuard is a fast, zero-config `.env` scanner for Node.js projects. It validates your environment variables and warns you about weak secrets, invalid ports, malformed URLs, and empty values β€” before you ship.
6
+
7
+ Built with Rust. Fast by default.
8
+
9
+ ---
10
+
11
+ ## ✨ Features
12
+
13
+ - πŸ” Scans your `.env` file instantly
14
+ - ❌ Detects weak secrets (`SECRET`, `KEY`, `API` too short)
15
+ - ❌ Catches invalid port values (e.g. `PORT=abc`)
16
+ - ❌ Flags malformed URLs (e.g. `DATABASE_URL=localhost`)
17
+ - ❌ Validates `NODE_ENV` values
18
+ - ⚠️ Warns about empty, malformed, or missing variables
19
+ - βœ… Priority-based rule engine
20
+ - βœ… Auto-generates `.env.example` from `.env`
21
+ - βœ… Clean, readable CLI output
22
+ - πŸ–₯️ Cross platform (Windows, Mac, Linux)
23
+ - πŸ€– Auto-builds via GitHub Actions
24
+
25
+ ---
26
+
27
+ ## πŸš€ Installation
28
+
29
+ ```bash
30
+ npx @deveko/devguard
31
+ ```
32
+
33
+ That's it. Works on Windows, Mac and Linux. No installation needed.
34
+
35
+ ---
36
+
37
+ ## πŸ“¦ Usage
38
+
39
+ Place a `.env` file in your project root, then run:
40
+
41
+ ```bash
42
+ # Scan default .env
43
+ npx @deveko/devguard check
44
+
45
+ # Scan a custom path
46
+ npx @deveko/devguard check --path ./apps/backend/.env
47
+
48
+ # Generate .env.example from .env
49
+ npx @deveko/devguard init
50
+ ```
51
+
52
+ ### Example `.env`
53
+
54
+ ```env
55
+ TEST2
56
+ PORT=abc
57
+ JWT_SECRET=123
58
+ DATABASE_URL=localhost
59
+ ```
60
+
61
+ ### Example output
62
+
63
+ ```bash
64
+ πŸ” DevGuard - scanning .env...
65
+
66
+ === Warning(s) ===
67
+ ⚠️ 'TEST2' is malformed - missing '='
68
+
69
+ === Error(s) ===
70
+ ❌ PORT -> must be a number
71
+ ❌ JWT_SECRET -> must be greater than or equal to 32
72
+ ❌ DATABASE_URL -> must start with http://, https://, postgres://...
73
+
74
+ === Missing(s) ===
75
+ ❌ REDIS_URL -> missing required variable
76
+
77
+ ⚠️ 4 error(s) and 1 warning(s) found
78
+ ```
79
+
80
+ When everything looks good:
81
+
82
+ ```bash
83
+ πŸ” DevGuard - scanning .env...
84
+
85
+ βœ… All checks passed! Your .env looks good!
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 🧠 How It Works
91
+
92
+ DevGuard runs three checks on your project:
93
+
94
+ **1. Parse Check**
95
+ Scans `.env` line by line for malformed entries
96
+
97
+ **2. Validation Check**
98
+ Runs pattern-based rules with priority ordering:
99
+
100
+ | Pattern | Rule |
101
+ | ------- | ---- |
102
+ | Key is `NODE_ENV` | Must be `development`, `production`, or `test` |
103
+ | Key contains `SECRET` or `KEY` or `API` | Value must be β‰₯ 32 characters |
104
+ | Key contains `URL` | Must start with a valid protocol (http, postgres, redis, etc.) |
105
+ | Key contains `PORT` | Must be a valid number (0-65535) |
106
+ | Key contains `HOST` | Must not be empty |
107
+ | Key contains `ID` | Must not be empty |
108
+
109
+ **3. Missing Keys Check**
110
+ Compares `.env` against `.env.example` - any key in `.env.example` missing from `.env` is flagged!!
111
+
112
+ No config needed. Just run it.
113
+
114
+ ---
115
+
116
+ ## πŸ—ΊοΈ Roadmap
117
+
118
+ - [x] `.env` parser
119
+ - [x] Pattern-based validation engine
120
+ - [x] CLI output with colors
121
+ - [x] `npx devguard` via npm
122
+ - [x] `--path` option for custom `.env` paths
123
+ - [x] Malformed line detection
124
+ - [x] Improved error summary
125
+ - [x] New validation rules
126
+ - [x] Priority system
127
+ - [x] `devguard init` -> auto-generate `.env.example`
128
+ - [x] Missing required keys detection
129
+ - [x] Sectioned output (Warnings, Errors, Missing)
130
+ - [x] CI/CD integration via GitHub Action
131
+ - [x] Cross platform binaries (Windows, Mac, Linux)
132
+ - [ ] Custom rules via `devguard.config.toml`
133
+ - [ ] VSCode extension
134
+ - [ ] Docker config validation
135
+ - [ ] Secret leak detection in source files
136
+
137
+ ---
138
+
139
+ ## πŸ”§ Local Development
140
+
141
+ ```bash
142
+ git clone https://github.com/ekojoecovenant/devguard.git
143
+ cd devguard
144
+ cargo build --release
145
+ node cli.js check
146
+ ```
147
+
148
+ ---
149
+
150
+ ## 🀝 Contributing
151
+
152
+ Contributions are welcome! Here's how to get started:
153
+
154
+ 1. Fork the repo
155
+ 2. Create a feature branch
156
+
157
+ ```bash
158
+ git checkout -b feature/your-feature-name
159
+ ```
160
+
161
+ 3. Make your changes
162
+ 4. Run the project locally to test
163
+
164
+ ```bash
165
+ cargo build --release
166
+ node cli.js check
167
+ ```
168
+
169
+ 5. Open a Pull Request with a clear description of what you changed and why
170
+
171
+ Please keep PRs focused β€” one feature or fix per PR.
172
+
173
+ ---
174
+
175
+ ## πŸ“„ License
176
+
177
+ MIT β€” use it, build on it, ship it.
178
+
179
+ ---
180
+
181
+ <p align="center">Built with πŸ¦€ Rust β€” by <a href="https://github.com/ekojoecovenant">ℭ𝔬𝔳𝔒</a></p>
package/bin/.gitkeep ADDED
File without changes
Binary file
Binary file
Binary file
package/cli.js CHANGED
@@ -1,23 +1,23 @@
1
- #!/usr/bin/env node
2
-
3
- const path = require('path');
4
- const os = require('os');
5
- const { spawnSync } = require('child_process');
6
-
7
- // detect OS and pick correct binary
8
- const platform = os.platform();
9
- const binaryName =
10
- platform === 'win32'
11
- ? 'devguard-win.exe'
12
- : platform === 'darwin'
13
- ? 'devguard-macos'
14
- : 'devguard-linux';
15
-
16
- const binaryPath = path.join(__dirname, 'bin', binaryName);
17
-
18
- // pass ALL argumets through to RUST binary
19
- const result = spawnSync(binaryPath, process.argv.slice(2), {
20
- stdio: 'inherit',
21
- });
22
-
23
- process.exit(result.status);
1
+ #!/usr/bin/env node
2
+
3
+ const path = require('path');
4
+ const os = require('os');
5
+ const { spawnSync } = require('child_process');
6
+
7
+ // detect OS and pick correct binary
8
+ const platform = os.platform();
9
+ const binaryName =
10
+ platform === 'win32'
11
+ ? 'devguard-win.exe'
12
+ : platform === 'darwin'
13
+ ? 'devguard-macos'
14
+ : 'devguard-linux';
15
+
16
+ const binaryPath = path.join(__dirname, 'bin', binaryName);
17
+
18
+ // pass ALL argumets through to RUST binary
19
+ const result = spawnSync(binaryPath, process.argv.slice(2), {
20
+ stdio: 'inherit',
21
+ });
22
+
23
+ process.exit(result.status);
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "name": "@deveko/devguard",
3
- "version": "0.1.7",
4
- "description": "A fast .env scanner for Node.js projects",
5
- "bin": {
6
- "devguard": "cli.js"
7
- },
8
- "files": [
9
- "cli.js",
10
- "bin/"
11
- ],
12
- "keywords": [
13
- "env",
14
- "security",
15
- "cli",
16
- "devtools",
17
- "validation"
18
- ],
19
- "author": "Ekojoe Covenant",
20
- "license": "MIT",
21
- "engines": {
22
- "node": ">=14.0.0"
23
- }
24
- }
1
+ {
2
+ "name": "@deveko/devguard",
3
+ "version": "0.1.10",
4
+ "description": "A fast .env scanner for Node.js projects",
5
+ "bin": {
6
+ "devguard": "cli.js"
7
+ },
8
+ "files": [
9
+ "cli.js",
10
+ "bin/"
11
+ ],
12
+ "keywords": [
13
+ "env",
14
+ "security",
15
+ "cli",
16
+ "devtools",
17
+ "validation"
18
+ ],
19
+ "author": "Ekojoe Covenant",
20
+ "license": "MIT",
21
+ "engines": {
22
+ "node": ">=14.0.0"
23
+ }
24
+ }