dotenv-diff 2.1.6 → 2.1.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.
- package/README.md +12 -2
- package/dist/src/index.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# dotenv-diff
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
3
5
|
Easily compare your .env, .env.example, and other environment files (like .env.local, .env.production) to detect missing, extra, empty, or mismatched variables — and ensure they’re properly ignored by Git.
|
|
4
6
|
|
|
5
7
|
Or scan your codebase to find out which environment variables are actually used in your code, and which ones are not.
|
|
@@ -35,6 +37,14 @@ dotenv-diff will automatically compare all matching .env* files in your project
|
|
|
35
37
|
- `.env.production`
|
|
36
38
|
- Any other .env.* file
|
|
37
39
|
|
|
40
|
+
## Why dotenv-diff?
|
|
41
|
+
|
|
42
|
+
- **Prevent production issues**: Ensure all required environment variables are defined before deploying.
|
|
43
|
+
- **Avoid runtime errors**: Catch missing or misconfigured variables early in development.
|
|
44
|
+
- **Improve collaboration**: Keep your team aligned on necessary environment variables.
|
|
45
|
+
- **Enhance security**: Ensure sensitive variables are not accidentally committed to version control.
|
|
46
|
+
- **Scale confidently**: Perfect for turbo monorepos and multi-environment setups.
|
|
47
|
+
|
|
38
48
|
## Scan your codebase for environment variable usage
|
|
39
49
|
|
|
40
50
|
```bash
|
|
@@ -50,11 +60,11 @@ Use the `--ci` flag for automated environments. This enables strict mode where t
|
|
|
50
60
|
|
|
51
61
|
And the `--example` option allows you to specify which `.env.example` file to compare against.
|
|
52
62
|
|
|
53
|
-
### Use it in Github Actions
|
|
63
|
+
### Use it in Github Actions Example:
|
|
54
64
|
|
|
55
65
|
```yaml
|
|
56
66
|
- name: Check environment variables
|
|
57
|
-
run: dotenv-diff --ci --scan-usage --
|
|
67
|
+
run: dotenv-diff --ci --scan-usage --example .env.example --ignore VITE_MODE,NODE_ENV
|
|
58
68
|
```
|
|
59
69
|
|
|
60
70
|
You can also change the comparison file by using the `--example` flag to point to a different `.env.example` file.
|
package/dist/src/index.js
CHANGED
package/package.json
CHANGED