Skip to main content
Wright Websites

dotenv-sentinel

validate .env files

Validate .env files against .env.example or a JSON schema (missing, empty, extra and mistyped variables), flag weak and default secrets, real secrets in example files, and .env files that are.

  • 37/week on npm
  • 2★
  • MIT
  • v1.1.0
  • Supply Chain
npx dotenv-sentinel

Read the full README on GitHub (opens in a new tab)View on npm (opens in a new tab)

dotenv-sentinel

From the README

dotenv-sentinel finds every .env, .env. and .env file in a project and checks three things: completeness (variables missing compared with .env.example or a JSON schema, empty required values, wrong types), secret hygiene (changeme, , short secrets, debug mode in production files, real credentials left in example files) and git exposure (env files that are tracked, not covered by .gitignore, or present anywhere in history). Values are never printed: every secret is masked. CLI, library and GitHub Action. Node.js 18+, one runtime dependency, bundle-secret-guard, whose shared provider…

npx dotenv-sentinel                       # current directory, including git checks
npx dotenv-sentinel apps/api --schema apps/api/env.schema.json
npx dotenv-sentinel .env.production --example .env.example --fail-on medium

Related packages

Supply Chain