@subramanyaks/env-drift 0.0.0-stage → 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/dist/index.js ADDED
@@ -0,0 +1,537 @@
1
+ // src/analyzer.ts
2
+ import { resolve } from "path";
3
+
4
+ // src/envParser.ts
5
+ import { existsSync, readFileSync, writeFileSync } from "fs";
6
+ var ENV_LINE_REGEX = /^(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/;
7
+ function parseValue(raw) {
8
+ const trimmed = raw.trim();
9
+ if (!trimmed) return "";
10
+ const quote = trimmed[0];
11
+ if (quote === '"') {
12
+ let result = "";
13
+ for (let i = 1; i < trimmed.length; i++) {
14
+ const ch = trimmed[i];
15
+ if (ch === "\\" && i + 1 < trimmed.length) {
16
+ const next = trimmed[i + 1];
17
+ if (next === "n") result += "\n";
18
+ else if (next === "r") result += "\r";
19
+ else if (next === "t") result += " ";
20
+ else result += next;
21
+ i++;
22
+ } else if (ch === '"') {
23
+ return result;
24
+ } else {
25
+ result += ch;
26
+ }
27
+ }
28
+ return result;
29
+ }
30
+ if (quote === "'") {
31
+ const closingIdx = trimmed.indexOf("'", 1);
32
+ if (closingIdx !== -1) {
33
+ return trimmed.slice(1, closingIdx);
34
+ }
35
+ return trimmed.slice(1);
36
+ }
37
+ const commentIdx = trimmed.indexOf(" #");
38
+ if (commentIdx !== -1) {
39
+ return trimmed.slice(0, commentIdx).trim();
40
+ }
41
+ return trimmed;
42
+ }
43
+ function parseEnvContent(content) {
44
+ const keys = [];
45
+ const seen = /* @__PURE__ */ new Set();
46
+ const duplicateSet = /* @__PURE__ */ new Set();
47
+ const values = {};
48
+ const lines = content.split(/\r?\n/);
49
+ for (const rawLine of lines) {
50
+ const line = rawLine.trim();
51
+ if (!line || line.startsWith("#")) continue;
52
+ const match = ENV_LINE_REGEX.exec(line);
53
+ if (!match) continue;
54
+ const key = match[1];
55
+ const rawValue = match[2] ?? "";
56
+ if (!key) continue;
57
+ if (seen.has(key)) {
58
+ duplicateSet.add(key);
59
+ } else {
60
+ seen.add(key);
61
+ keys.push(key);
62
+ }
63
+ values[key] = parseValue(rawValue);
64
+ }
65
+ return {
66
+ keys,
67
+ values,
68
+ duplicates: Array.from(duplicateSet)
69
+ };
70
+ }
71
+ function parseEnvFile(filePath) {
72
+ if (!existsSync(filePath)) {
73
+ return {
74
+ filePath,
75
+ exists: false,
76
+ keys: [],
77
+ values: {},
78
+ duplicates: []
79
+ };
80
+ }
81
+ const content = readFileSync(filePath, "utf-8");
82
+ const { keys, values, duplicates } = parseEnvContent(content);
83
+ return {
84
+ filePath,
85
+ exists: true,
86
+ keys,
87
+ values,
88
+ duplicates
89
+ };
90
+ }
91
+ function syncEnvExample(examplePath, missingKeys) {
92
+ const uniqueKeys = Array.from(new Set(missingKeys)).sort();
93
+ if (uniqueKeys.length === 0) {
94
+ return { added: [], created: false };
95
+ }
96
+ const created = !existsSync(examplePath);
97
+ const existingContent = created ? "" : readFileSync(examplePath, "utf-8");
98
+ const existingKeys = new Set(parseEnvContent(existingContent).keys);
99
+ const toAdd = uniqueKeys.filter((k) => !existingKeys.has(k));
100
+ if (toAdd.length === 0) {
101
+ return { added: [], created: false };
102
+ }
103
+ const linesBlock = toAdd.map((k) => `${k}=`).join("\n") + "\n";
104
+ let nextContent;
105
+ if (created || existingContent.trim() === "") {
106
+ nextContent = linesBlock;
107
+ } else {
108
+ const separator = existingContent.endsWith("\n") ? "" : "\n";
109
+ nextContent = `${existingContent}${separator}${linesBlock}`;
110
+ }
111
+ writeFileSync(examplePath, nextContent, "utf-8");
112
+ return { added: toAdd, created };
113
+ }
114
+
115
+ // src/scanner.ts
116
+ import { readdirSync, readFileSync as readFileSync2, statSync } from "fs";
117
+ import { extname, join, relative } from "path";
118
+ var DEFAULT_IGNORE_DIRS = /* @__PURE__ */ new Set([
119
+ "node_modules",
120
+ ".git",
121
+ "dist",
122
+ "build",
123
+ ".next",
124
+ ".nuxt",
125
+ ".svelte-kit",
126
+ ".vercel",
127
+ ".turbo",
128
+ "coverage",
129
+ "out",
130
+ ".cache"
131
+ ]);
132
+ var DEFAULT_EXTENSIONS = /* @__PURE__ */ new Set([
133
+ ".js",
134
+ ".jsx",
135
+ ".ts",
136
+ ".tsx",
137
+ ".mjs",
138
+ ".cjs",
139
+ ".mts",
140
+ ".cts",
141
+ ".vue",
142
+ ".svelte",
143
+ ".astro"
144
+ ]);
145
+ function stripCommentsPreservingLines(source) {
146
+ const tokenRegex = /("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`)|\/\*[\s\S]*?\*\/|\/\/[^\r\n]*/g;
147
+ return source.replace(tokenRegex, (match, stringLiteral) => {
148
+ if (stringLiteral) return match;
149
+ return match.replace(/[^\r\n]/g, " ");
150
+ });
151
+ }
152
+ function getLineNumber(source, index) {
153
+ let line = 1;
154
+ for (let i = 0; i < index; i++) {
155
+ if (source.charCodeAt(i) === 10) line++;
156
+ }
157
+ return line;
158
+ }
159
+ function extractEnvReferences(content, filePath) {
160
+ const cleaned = stripCommentsPreservingLines(content);
161
+ const refs = [];
162
+ const normalizedFile = filePath.replace(/\\/g, "/");
163
+ const dotRegex = /\b(process\.env|import\.meta\.env)\s*\??\.\s*([A-Za-z_][A-Za-z0-9_]*)\b/g;
164
+ for (const match of cleaned.matchAll(dotRegex)) {
165
+ const source = match[1];
166
+ const name = match[2];
167
+ if (!name || match.index === void 0) continue;
168
+ refs.push({
169
+ name,
170
+ file: normalizedFile,
171
+ line: getLineNumber(cleaned, match.index),
172
+ source
173
+ });
174
+ }
175
+ const bracketRegex = /\b(process\.env|import\.meta\.env)\s*(?:\?\.)?\s*\[\s*["']([A-Za-z_][A-Za-z0-9_]*)["']\s*\]/g;
176
+ for (const match of cleaned.matchAll(bracketRegex)) {
177
+ const source = match[1];
178
+ const name = match[2];
179
+ if (!name || match.index === void 0) continue;
180
+ refs.push({
181
+ name,
182
+ file: normalizedFile,
183
+ line: getLineNumber(cleaned, match.index),
184
+ source
185
+ });
186
+ }
187
+ const destructureRegex = /\{([^}]+)\}\s*=\s*(process\.env|import\.meta\.env)\b/g;
188
+ for (const match of cleaned.matchAll(destructureRegex)) {
189
+ const body = match[1];
190
+ const source = match[2];
191
+ if (!body || match.index === void 0) continue;
192
+ const bodyStart = match.index + 1;
193
+ let offset = 0;
194
+ for (const part of body.split(",")) {
195
+ const partIdx = body.indexOf(part, offset);
196
+ offset = partIdx + part.length + 1;
197
+ const trimmed = part.trim();
198
+ if (!trimmed || trimmed.startsWith("...")) continue;
199
+ const keyMatch = /^([A-Za-z_][A-Za-z0-9_]*)/.exec(trimmed);
200
+ const name = keyMatch?.[1];
201
+ if (!name) continue;
202
+ const leadingWs = part.indexOf(name);
203
+ const absoluteIdx = bodyStart + partIdx + Math.max(0, leadingWs);
204
+ refs.push({
205
+ name,
206
+ file: normalizedFile,
207
+ line: getLineNumber(cleaned, absoluteIdx),
208
+ source
209
+ });
210
+ }
211
+ }
212
+ refs.sort((a, b) => a.line - b.line);
213
+ return refs;
214
+ }
215
+ function scanFiles(rootDir, options = {}) {
216
+ const ignoreDirs = options.ignoreDirs ? new Set(options.ignoreDirs) : DEFAULT_IGNORE_DIRS;
217
+ const extensions = options.extensions ? new Set(options.extensions) : DEFAULT_EXTENSIONS;
218
+ let scannedFiles = 0;
219
+ const references = [];
220
+ function walk(currentDir) {
221
+ const entries = readdirSync(currentDir, { withFileTypes: true });
222
+ for (const entry of entries) {
223
+ const fullPath = join(currentDir, entry.name);
224
+ if (entry.isDirectory()) {
225
+ if (ignoreDirs.has(entry.name)) continue;
226
+ walk(fullPath);
227
+ } else if (entry.isFile()) {
228
+ const ext = extname(entry.name).toLowerCase();
229
+ if (!extensions.has(ext)) continue;
230
+ const size = statSync(fullPath).size;
231
+ if (size > 2 * 1024 * 1024) continue;
232
+ scannedFiles++;
233
+ const content = readFileSync2(fullPath, "utf-8");
234
+ const relPath = relative(rootDir, fullPath);
235
+ const fileRefs = extractEnvReferences(content, relPath);
236
+ references.push(...fileRefs);
237
+ }
238
+ }
239
+ }
240
+ walk(rootDir);
241
+ return { scannedFiles, references };
242
+ }
243
+
244
+ // src/analyzer.ts
245
+ var BUILTIN_ENV_VARS = /* @__PURE__ */ new Set([
246
+ "NODE_ENV",
247
+ "CI",
248
+ "MODE",
249
+ "DEV",
250
+ "PROD",
251
+ "SSR",
252
+ "BASE_URL"
253
+ ]);
254
+ var PUBLIC_ENV_PREFIXES = [
255
+ "NEXT_PUBLIC_",
256
+ "VITE_",
257
+ "REACT_APP_",
258
+ "NUXT_PUBLIC_",
259
+ "PUBLIC_",
260
+ "EXPO_PUBLIC_",
261
+ "GATSBY_"
262
+ ];
263
+ var SENSITIVE_KEYWORDS = [
264
+ "SECRET",
265
+ "PASSWORD",
266
+ "PASSWD",
267
+ "PRIVATE_KEY",
268
+ "PRIVATE",
269
+ "DATABASE_URL",
270
+ "DB_URL",
271
+ "DB_PASS",
272
+ "JWT_SECRET",
273
+ "AUTH_TOKEN",
274
+ "ACCESS_KEY",
275
+ "API_SECRET",
276
+ "SERVICE_ROLE",
277
+ "CREDENTIALS"
278
+ ];
279
+ function detectSecretExposure(name) {
280
+ const upper = name.toUpperCase();
281
+ const prefix = PUBLIC_ENV_PREFIXES.find((p) => upper.startsWith(p));
282
+ if (!prefix) return null;
283
+ const rest = upper.slice(prefix.length);
284
+ const matchedKeyword = SENSITIVE_KEYWORDS.find((kw) => rest.includes(kw));
285
+ if (!matchedKeyword) return null;
286
+ return { prefix, matchedKeyword };
287
+ }
288
+ function auditEnv(options = {}) {
289
+ const rootDir = resolve(options.rootDir ?? process.cwd());
290
+ const envFileName = options.envFile ?? ".env";
291
+ const exampleFileName = options.exampleFile ?? ".env.example";
292
+ const ignoreSet = /* @__PURE__ */ new Set([...BUILTIN_ENV_VARS, ...options.ignore ?? []]);
293
+ const { scannedFiles, references } = scanFiles(rootDir);
294
+ const usedInCode = {};
295
+ for (const ref of references) {
296
+ if (!usedInCode[ref.name]) {
297
+ usedInCode[ref.name] = [];
298
+ }
299
+ usedInCode[ref.name].push(ref);
300
+ }
301
+ const parsedEnv = parseEnvFile(resolve(rootDir, envFileName));
302
+ const parsedExample = parseEnvFile(resolve(rootDir, exampleFileName));
303
+ let envFileExists = parsedEnv.exists;
304
+ const localEnvKeys = new Set(parsedEnv.keys);
305
+ if (!options.envFile) {
306
+ const parsedLocal = parseEnvFile(resolve(rootDir, ".env.local"));
307
+ if (parsedLocal.exists) {
308
+ envFileExists = true;
309
+ }
310
+ for (const key of parsedLocal.keys) {
311
+ localEnvKeys.add(key);
312
+ }
313
+ }
314
+ const exampleKeys = new Set(parsedExample.keys);
315
+ const codeKeys = Object.keys(usedInCode);
316
+ const codeKeySet = new Set(codeKeys);
317
+ const missingInEnv = codeKeys.filter((k) => !ignoreSet.has(k) && !localEnvKeys.has(k)).sort();
318
+ const missingInExample = codeKeys.filter((k) => !ignoreSet.has(k) && !exampleKeys.has(k)).sort();
319
+ const unusedInEnv = parsedEnv.keys.filter((k) => !ignoreSet.has(k) && !codeKeySet.has(k)).sort();
320
+ const unusedInExample = parsedExample.keys.filter((k) => !ignoreSet.has(k) && !codeKeySet.has(k)).sort();
321
+ const allKnownKeys = /* @__PURE__ */ new Set([
322
+ ...codeKeys,
323
+ ...localEnvKeys,
324
+ ...exampleKeys
325
+ ]);
326
+ const secretExposures = [];
327
+ for (const key of Array.from(allKnownKeys).sort()) {
328
+ if (ignoreSet.has(key)) continue;
329
+ const hit = detectSecretExposure(key);
330
+ if (hit) {
331
+ secretExposures.push({
332
+ name: key,
333
+ prefix: hit.prefix,
334
+ matchedKeyword: hit.matchedKeyword,
335
+ references: usedInCode[key] ?? []
336
+ });
337
+ }
338
+ }
339
+ return {
340
+ rootDir,
341
+ scannedFiles,
342
+ envFileExists,
343
+ exampleFileExists: parsedExample.exists,
344
+ usedInCode,
345
+ missingInEnv,
346
+ missingInExample,
347
+ unusedInEnv,
348
+ unusedInExample,
349
+ secretExposures,
350
+ duplicateKeys: {
351
+ env: parsedEnv.duplicates,
352
+ example: parsedExample.duplicates
353
+ }
354
+ };
355
+ }
356
+
357
+ // src/typegen.ts
358
+ import { mkdirSync, writeFileSync as writeFileSync2 } from "fs";
359
+ import { dirname } from "path";
360
+ function generateEnvTypes(result) {
361
+ const processKeys = /* @__PURE__ */ new Set();
362
+ const importMetaKeys = /* @__PURE__ */ new Set();
363
+ for (const [key, refs] of Object.entries(result.usedInCode)) {
364
+ if (BUILTIN_ENV_VARS.has(key)) continue;
365
+ for (const ref of refs) {
366
+ if (ref.source === "import.meta.env") {
367
+ importMetaKeys.add(key);
368
+ } else {
369
+ processKeys.add(key);
370
+ }
371
+ }
372
+ }
373
+ for (const key of result.unusedInExample) {
374
+ if (!BUILTIN_ENV_VARS.has(key) && !importMetaKeys.has(key)) {
375
+ processKeys.add(key);
376
+ }
377
+ }
378
+ const lines = [
379
+ "// Auto-generated by env-drift. Do not edit manually.",
380
+ ""
381
+ ];
382
+ const sortedProcess = Array.from(processKeys).sort();
383
+ if (sortedProcess.length > 0) {
384
+ lines.push("declare namespace NodeJS {");
385
+ lines.push(" interface ProcessEnv {");
386
+ for (const key of sortedProcess) {
387
+ lines.push(` ${key}: string;`);
388
+ }
389
+ lines.push(" }");
390
+ lines.push("}");
391
+ lines.push("");
392
+ }
393
+ const sortedMeta = Array.from(importMetaKeys).sort();
394
+ if (sortedMeta.length > 0) {
395
+ lines.push("interface ImportMetaEnv {");
396
+ for (const key of sortedMeta) {
397
+ lines.push(` readonly ${key}: string;`);
398
+ }
399
+ lines.push("}");
400
+ lines.push("");
401
+ lines.push("interface ImportMeta {");
402
+ lines.push(" readonly env: ImportMetaEnv;");
403
+ lines.push("}");
404
+ lines.push("");
405
+ }
406
+ if (sortedProcess.length === 0 && sortedMeta.length === 0) {
407
+ lines.push("// No environment variables detected.");
408
+ lines.push("");
409
+ }
410
+ return lines.join("\n");
411
+ }
412
+ function writeEnvTypes(outputPath, result) {
413
+ const content = generateEnvTypes(result);
414
+ mkdirSync(dirname(outputPath), { recursive: true });
415
+ writeFileSync2(outputPath, content, "utf-8");
416
+ const uniqueKeys = /* @__PURE__ */ new Set([
417
+ ...Object.keys(result.usedInCode).filter((k) => !BUILTIN_ENV_VARS.has(k)),
418
+ ...result.unusedInExample.filter((k) => !BUILTIN_ENV_VARS.has(k))
419
+ ]);
420
+ return { outputPath, count: uniqueKeys.size };
421
+ }
422
+
423
+ // src/reporter.ts
424
+ import pc from "picocolors";
425
+ function formatRefs(refs) {
426
+ if (!refs || refs.length === 0) return "";
427
+ const shown = refs.slice(0, 2).map((r) => `${r.file}:${r.line}`);
428
+ const extra = refs.length > 2 ? ` (+${refs.length - 2} more)` : "";
429
+ return pc.dim(` \u2190 ${shown.join(", ")}${extra}`);
430
+ }
431
+ function hasBlockingIssues(result, options = {}) {
432
+ const checkMissingInEnv = options.requireEnvFile ? true : result.envFileExists;
433
+ return checkMissingInEnv && result.missingInEnv.length > 0 || result.missingInExample.length > 0 || result.secretExposures.length > 0;
434
+ }
435
+ function formatAuditReport(result, options = {}) {
436
+ const envFile = options.envFile ?? ".env";
437
+ const exampleFile = options.exampleFile ?? ".env.example";
438
+ const skipMissingInEnv = Boolean(options.ci && !result.envFileExists);
439
+ const lines = [];
440
+ lines.push("");
441
+ lines.push(
442
+ `${pc.bold(pc.cyan("env-drift"))} ${pc.dim(
443
+ `\u2014 scanned ${result.scannedFiles} file${result.scannedFiles === 1 ? "" : "s"}`
444
+ )}`
445
+ );
446
+ lines.push("");
447
+ const totalIssues = result.secretExposures.length + (skipMissingInEnv ? 0 : result.missingInEnv.length) + result.missingInExample.length + result.unusedInEnv.length + result.unusedInExample.length + result.duplicateKeys.env.length + result.duplicateKeys.example.length;
448
+ if (totalIssues === 0) {
449
+ lines.push(pc.green("\u2714 No environment drift detected. Everything is in sync!"));
450
+ if (skipMissingInEnv && result.missingInEnv.length > 0) {
451
+ lines.push(
452
+ pc.dim(` (No ${envFile} file found \u2014 skipped local ${envFile} check in CI mode)`)
453
+ );
454
+ }
455
+ lines.push("");
456
+ return lines.join("\n");
457
+ }
458
+ if (result.secretExposures.length > 0) {
459
+ lines.push(pc.bold(pc.red(`\u2716 Possible Public Secret Exposure (${result.secretExposures.length})`)));
460
+ for (const item of result.secretExposures) {
461
+ lines.push(
462
+ ` ${pc.red("\u2022")} ${pc.bold(item.name)} ${pc.dim(
463
+ `(public prefix "${item.prefix}" + sensitive "${item.matchedKeyword}")`
464
+ )}${formatRefs(item.references)}`
465
+ );
466
+ }
467
+ lines.push("");
468
+ }
469
+ if (!skipMissingInEnv && result.missingInEnv.length > 0) {
470
+ lines.push(pc.bold(pc.red(`\u2716 Missing in ${envFile} (${result.missingInEnv.length})`)));
471
+ for (const key of result.missingInEnv) {
472
+ lines.push(` ${pc.red("\u2022")} ${key}${formatRefs(result.usedInCode[key])}`);
473
+ }
474
+ lines.push("");
475
+ } else if (skipMissingInEnv && result.missingInEnv.length > 0) {
476
+ lines.push(
477
+ pc.dim(`\u2139 No ${envFile} file found \u2014 skipped local ${envFile} check in CI mode`)
478
+ );
479
+ lines.push("");
480
+ }
481
+ if (result.missingInExample.length > 0) {
482
+ lines.push(pc.bold(pc.yellow(`\u26A0 Missing in ${exampleFile} (${result.missingInExample.length})`)));
483
+ for (const key of result.missingInExample) {
484
+ lines.push(` ${pc.yellow("\u2022")} ${key}${formatRefs(result.usedInCode[key])}`);
485
+ }
486
+ lines.push("");
487
+ }
488
+ if (result.unusedInEnv.length > 0) {
489
+ lines.push(pc.bold(pc.cyan(`\u25CB Unused in ${envFile} (${result.unusedInEnv.length})`)));
490
+ for (const key of result.unusedInEnv) {
491
+ lines.push(` ${pc.dim("\u2022")} ${key}`);
492
+ }
493
+ lines.push("");
494
+ }
495
+ if (result.unusedInExample.length > 0) {
496
+ lines.push(pc.bold(pc.cyan(`\u25CB Unused in ${exampleFile} (${result.unusedInExample.length})`)));
497
+ for (const key of result.unusedInExample) {
498
+ lines.push(` ${pc.dim("\u2022")} ${key}`);
499
+ }
500
+ lines.push("");
501
+ }
502
+ if (result.duplicateKeys.env.length > 0 || result.duplicateKeys.example.length > 0) {
503
+ lines.push(pc.bold(pc.yellow("\u26A0 Duplicate Keys")));
504
+ for (const key of result.duplicateKeys.env) {
505
+ lines.push(` ${pc.yellow("\u2022")} ${key} ${pc.dim(`in ${envFile}`)}`);
506
+ }
507
+ for (const key of result.duplicateKeys.example) {
508
+ lines.push(` ${pc.yellow("\u2022")} ${key} ${pc.dim(`in ${exampleFile}`)}`);
509
+ }
510
+ lines.push("");
511
+ }
512
+ if (result.missingInExample.length > 0) {
513
+ lines.push(
514
+ pc.dim(`Tip: Run with ${pc.white("--sync")} to safely append missing keys to ${exampleFile}.`)
515
+ );
516
+ lines.push("");
517
+ }
518
+ return lines.join("\n");
519
+ }
520
+ export {
521
+ BUILTIN_ENV_VARS,
522
+ DEFAULT_EXTENSIONS,
523
+ DEFAULT_IGNORE_DIRS,
524
+ PUBLIC_ENV_PREFIXES,
525
+ SENSITIVE_KEYWORDS,
526
+ auditEnv,
527
+ detectSecretExposure,
528
+ extractEnvReferences,
529
+ formatAuditReport,
530
+ generateEnvTypes,
531
+ hasBlockingIssues,
532
+ parseEnvContent,
533
+ parseEnvFile,
534
+ scanFiles,
535
+ syncEnvExample,
536
+ writeEnvTypes
537
+ };
package/package.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "@subramanyaks/env-drift",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.1",
4
+ "description": "Zero-config CLI and library to detect environment variable drift, missing keys, dead vars, and accidental public secret exposure.",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "main": "./dist/index.cjs",
10
+ "module": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "bin": {
13
+ "env-drift": "./dist/cli.js"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js",
19
+ "require": "./dist/index.cjs"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md",
25
+ "LICENSE"
26
+ ],
27
+ "engines": {
28
+ "node": ">=18.17.0"
29
+ },
30
+ "scripts": {
31
+ "dev": "tsup --watch",
32
+ "build": "tsup",
33
+ "typecheck": "tsc --noEmit",
34
+ "test": "vitest run",
35
+ "test:watch": "vitest",
36
+ "prepublishOnly": "npm run typecheck && npm test && npm run build"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/SubramanyaKS/env-drift.git"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/SubramanyaKS/env-drift/issues"
44
+ },
45
+ "keywords": [
46
+ "env",
47
+ "dotenv",
48
+ "env-drift",
49
+ "environment",
50
+ "cli",
51
+ "security",
52
+ "audit",
53
+ "typescript",
54
+ "ci",
55
+ "nextjs",
56
+ "vite"
57
+ ],
58
+ "author": "SubramanyaKS",
59
+ "license": "MIT",
60
+ "dependencies": {
61
+ "picocolors": "^1.1.1"
62
+ },
63
+ "devDependencies": {
64
+ "@types/node": "^22.20.7",
65
+ "tsup": "^8.5.1",
66
+ "typescript": "^5.9.3",
67
+ "vitest": "^4.0.18"
68
+ }
69
+ }