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

@elilands/env-guardian

v1.0.0

Published

A high-performance CLI for scanning, validating, and syncing .env files.

Readme

🛡️ env-guardian

The elite, lightning-fast CLI to keep your environment variables perfectly synced.

Ever pushed a broken app to production because you forgot to add a new environment variable to your .env file? We've all been there.

env-guardian scans your actual source code, finds every process.env variable you are using, and cross-references them with your local .env and .env.example files. It tells you what's missing, what's empty, and can even fix your template files automatically.


✨ Features

  • 🧠 Smart Scanning: Reads your codebase in milliseconds to find exactly what environment variables your code actually needs.
  • 🔍 Catch Missing Variables: Alerts you if your local .env is missing variables required by your code.
  • 🛡️ Value Validation: Detects if you accidentally left an active .env variable empty.
  • 🔧 Auto-Fix Magic: Run with --fix and it will automatically append missing variables to your .env.example safely (with empty values), so you never leak secrets.
  • ⚡ Blazing Fast: Built with modern TypeScript, ESM, and asynchronous parallel reading.

📦 Installation

You don't need to install it globally if you don't want to. You can run it directly using your favorite package manager:

# Using NPM
npx env-guardian validate

# Using PNPM
pnpm dlx env-guardian validate

# Using Yarn
yarn dlx env-guardian validate

Want to add it to your project's CI/CD pipeline? Install it as a dev dependency:

npm install -D env-guardian

🚀 Usage

env-guardian is designed to be ridiculously simple. Just open your terminal in your project folder and run:

1. Validate & Sync (The Command You Want)

This cross-references your code with your .env files and tells you what's wrong.

npx env-guardian validate

Want to automatically update your .env.example? Just add the --fix flag. It will safely add any missing keys without touching your existing comments or formatting.

npx env-guardian validate --fix

2. Just Scan

If you only want to see a list of the variables your project is currently using (without checking the .env files), use the scan command:

npx env-guardian scan

3. Ignore Folders

By default, env-guardian ignores node_modules, .git, and build folders like dist or .next. If you have a massive monorepo and want to skip a specific folder to make it even faster, use --ignore:

npx env-guardian validate --ignore "**/legacy-app/**"

🤝 Contributing

Found a bug or have an idea to make this better? PRs are always welcome!

  1. Clone the repo.
  2. Run npm install.
  3. Make your changes in the src/ directory.
  4. Run npm run test to make sure the core regex engine is still happy.
  5. Submit your PR!

📄 License

ISC License. See package.json for details. Built for developers, by developers.