npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lorenzopant/envdrift

v1.0.1

Published

CLI that finds keys missing or extra across your .env files — catch config drift between local, staging, and production before it breaks a deploy.

Downloads

16

Readme

envdrift 🌱⚡

CLI that detects drift between .env* files in a project — catches the case where a variable is set in .env.local but missing from .env.production (or vice versa) before it causes a runtime surprise.

It compares keys only, never values — no secrets are read into memory or printed. 🔒

📦 Install / run

Published as a scoped package — install globally and run as envdrift:

npm install -g @lorenzopant/envdrift
envdrift [dir]

Or run it ad-hoc without installing:

npx @lorenzopant/envdrift [dir]

From source

pnpm install
pnpm run build
node dist/index.js [dir]

Or during development, skip the build step:

pnpm dev [dir]

[dir] defaults to the current directory.

🚀 Usage

envdrift [dir] [options]

| Option | Description | | --- | --- | | --depth <n> | max directory depth to scan (default: 5) | | --autofix | append missing keys (empty value) to files where they're absent, marked with a # --- added by envdrift --autofix --- comment | | --md [path] | write a Markdown drift report to <path> (default: envdrift-report.md) | | --fail-on-drift | exit with code 1 when drift is found (CI/CD gate) |

Example

$ envdrift .

Scanned 3 env file(s):
  - .env (4 keys)
  - .env.local (4 keys)
  - .env.production (7 keys)

Drift found in 3 key(s):

Legend:
  F1 = .env
  F2 = .env.local
  F3 = .env.production

                F1  F2  F3
  ------------  --  --  --
  GITHUB_TOKEN  ✗   ✓   ✗
  RATE_LIMIT_MAX ✗  ✗   ✓
  SENTRY_DSN    ✗   ✗   ✓

By default, exit code is always 0 — envdrift reports drift without failing your build. Pass --fail-on-drift to exit with code 1 when drift is found, turning it into a CI/CD gate:

envdrift . --fail-on-drift

Use --md to produce a file you can attach to CI artifacts or PRs if you want drift to be visible in review regardless of whether the build fails.

⚙️ How it works

  1. Scan — recursively find .env* files (skips node_modules, .git, build output dirs).
  2. Parse — read each file's keys via dotenv (values discarded).
  3. Diff — build a presence matrix across all files; any key not present in every file counts as drift.
  4. Report — render as a terminal matrix, optionally a Markdown file, and optionally autofix by appending missing keys with empty values.

🗂️ Project layout

src/
  scanner.ts   find .env* files on disk
  parser.ts    parse a file into its set of keys
  diff.ts      build the drift report (presence matrix)
  report.ts    render the report (terminal matrix, Markdown)
  autofix.ts   append missing keys to files
  index.ts     CLI entry point (commander)

🤝 Contributing

Contributions welcome — see CONTRIBUTING.md for setup, dev workflow, and conventions. Please follow our Code of Conduct.

📄 License

MIT © Lorenzo Pantano