Skip to content

mayank8025/env-diff-now

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

env-diff-now

Compare .env against .env.example and catch missing, empty, or extra environment variables — before they break your build.

Why

Every team has that moment: someone adds a new required env var, forgets to tell anyone, and a teammate's app silently breaks (or worse, deploys with a missing secret). env-diff-now catches this in seconds.

Install

npm install --save-dev env-diff-now

Or run without installing:

npx env-diff-now

Usage

env-diff-now
✖ Missing (2):
  - DATABASE_URL
  - STRIPE_SECRET_KEY

⚠ Empty (1):
  - API_TIMEOUT

ℹ Extra — present in .env but not in .env.example (1):
  - DEBUG_MODE

Options

Flag Description Default
--env <path> Path to actual env file .env
--example <path> Path to example env file .env.example
--strict Also fail (exit 1) on empty vars, not just missing false
--quiet, -q Only print output when there's a problem false
--help, -h Show help
--version, -v Show version

Exit Codes

  • 0 — all good
  • 1 — missing (or empty, with --strict) variables found
  • 2.env.example file not found

Use in CI

# .github/workflows/ci.yml
- name: Check env vars
  run: npx env-diff-now --strict

Use in postinstall

{
  "scripts": {
    "postinstall": "env-diff-now --quiet || echo 'Check your .env file — see above'"
  }
}

Tip: postinstall runs even without a .env present on fresh clones — env-diff-now handles that gracefully and just reports every example var as missing, guiding new contributors to set things up correctly.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors