dotenv-diff 2.1.4 → 2.1.5

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
@@ -105,7 +105,7 @@ dotenv-diff --scan-usage --fix
105
105
 
106
106
  Using `--fix`with `--scan-usage` will not detect duplicate keys, it will only add missing keys.
107
107
 
108
- # Example workflow
108
+ ### Example workflow
109
109
 
110
110
  1. You add `process.env.NEW_API_KEY` in your code.
111
111
  2. You run `dotenv-diff --scan-usage --fix`.
@@ -194,6 +194,16 @@ You can output the results in JSON format using the `--json` option:
194
194
  dotenv-diff --json
195
195
  ```
196
196
 
197
+ ## Disable colored output
198
+
199
+ By default, `dotenv-diff` uses colored output to enhance readability.
200
+
201
+ If you prefer plain text output, you can disable colored output using the `--no-color` option:
202
+
203
+ ```bash
204
+ dotenv-diff --no-color
205
+ ```
206
+
197
207
  ## Compare specific files
198
208
 
199
209
  Override the autoscan and compare exactly two files:
@@ -13,6 +13,7 @@ export function createProgram() {
13
13
  .option('--ignore-regex <pattern>', 'Regex pattern to ignore matching keys')
14
14
  .option('--fix', 'Automatically fix common issues: remove duplicates, add missing keys')
15
15
  .option('--json', 'Output results in JSON format')
16
+ .option('--no-color', 'Disable colored output')
16
17
  .option('--only <list>', 'Comma-separated categories to only run (missing,extra,empty,mismatch,duplicate,gitignore)')
17
18
  .option('--scan-usage', 'Scan codebase for environment variable usage')
18
19
  .option('--include-files <patterns>', '[requires --scan-usage] Comma-separated file patterns to ADD to default scan patterns (extends default)')
@@ -11,6 +11,9 @@ export async function run(program) {
11
11
  program.parse(process.argv);
12
12
  const raw = program.opts();
13
13
  const opts = normalizeOptions(raw);
14
+ if (opts.noColor) {
15
+ chalk.level = 0; // disable colors globally
16
+ }
14
17
  if (opts.scanUsage) {
15
18
  const envPath = opts.envFlag || (fs.existsSync('.env') ? '.env' : undefined);
16
19
  const { exitWithError } = await scanUsage({
@@ -19,6 +19,7 @@ export type Options = {
19
19
  showUnused: boolean;
20
20
  showStats: boolean;
21
21
  files?: string[];
22
+ noColor?: boolean;
22
23
  };
23
24
  export type RawOptions = {
24
25
  checkValues?: boolean;
package/dist/src/index.js CHANGED
@@ -1,4 +1,2 @@
1
1
  export { parseEnvFile } from './lib/parseEnv.js';
2
2
  export { diffEnv } from './lib/diffEnv.js';
3
- process.env.VITE_HEJ ??= 'production';
4
- process.env.FEATURE_2FLAG ??= 'enabled';
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "dotenv-diff",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "type": "module",
5
- "description": "A CLI tool to find differences between .env and .env.example / .env.* files. And optionally scan your codebase to find out which environment variables are actually used in your code.",
5
+ "description": "Find differences between .env and .env.example / .env.* files. And optionally scan your codebase to find environment variables in use.",
6
6
  "bin": {
7
7
  "dotenv-diff": "dist/bin/dotenv-diff.js"
8
8
  },