env-example-doctor 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 +3 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# env-doctor
|
|
2
2
|
|
|
3
|
-
**npm package:** [`dotenv-doctor`](https://www.npmjs.com/package/dotenv-doctor) — the unscoped name `env-doctor` is blocked by npm (too similar to [`envdoctor`](https://www.npmjs.com/package/envdoctor)). The CLI command is still **`env-doctor`**.
|
|
4
|
-
|
|
5
3
|
Source: [github.com/maliuppal/env-doctor](https://github.com/maliuppal/env-doctor)
|
|
6
4
|
|
|
7
5
|
Keep **`.env.example` in sync with your code**—find env vars used in source but missing from the example file, and keys documented but never used. **CI exit codes**, `--suggest` to fix drift. Supports `process.env`, `process.env['KEY']`, Vite `import.meta.env`, and `const { X } = process.env`. Zero runtime dependencies.
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
|
-
npm install
|
|
8
|
+
npm install env-example-doctor
|
|
11
9
|
npx env-doctor . --fail-on missing
|
|
12
10
|
```
|
|
13
11
|
|
|
@@ -61,7 +59,7 @@ env-doctor . --json
|
|
|
61
59
|
## Library examples
|
|
62
60
|
|
|
63
61
|
```ts
|
|
64
|
-
import { analyzeEnv, shouldFail, suggestEnvExampleLines } from '
|
|
62
|
+
import { analyzeEnv, shouldFail, suggestEnvExampleLines } from 'env-example-doctor';
|
|
65
63
|
|
|
66
64
|
const report = await analyzeEnv({
|
|
67
65
|
root: process.cwd(),
|
|
@@ -79,7 +77,7 @@ console.log(suggestEnvExampleLines(report.missingInExample).join('\n'));
|
|
|
79
77
|
```
|
|
80
78
|
|
|
81
79
|
```ts
|
|
82
|
-
import { scanSourceForEnv, parseEnvExample } from '
|
|
80
|
+
import { scanSourceForEnv, parseEnvExample } from 'env-example-doctor';
|
|
83
81
|
|
|
84
82
|
scanSourceForEnv("const u = process.env['API_URL']");
|
|
85
83
|
// => Set { 'API_URL' }
|