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

@reactmode/env-check

v1.0.1

Published

Validate .env against .env.example

Readme

# @reactmode/env-check

Validate your `.env` file against `.env.example` before runtime. Catch missing or extra environment variables early — especially useful for Next.js, Vite, and Node.js projects.

## 📦 Installation

### Using npx (recommended)

```bash
npx @reactmode/env-check
```

Install globally

npm install -g @reactmode/env-check

Then run:

env-check

🚀 What It Does

Compares:

  • .env
  • .env.example

And reports:

  • ❌ Missing variables (defined in .env.example but not in .env)
  • ⚠️ Extra variables (defined in .env but not in .env.example)
  • ✅ Valid environment when both match

The command exits with:

  • 0 → No issues found
  • 1 → Mismatch detected

This makes it suitable for CI pipelines.

📁 Expected Project Structure

Your project should contain:

.env
.env.example

Example

.env.example

VITE_API_URL=
VITE_CLIENT_URL=
VITE_LUMI_API_KEY=

.env

VITE_API_URL=https://api.example.com
VITE_CLIENT_URL=http://localhost:5173
VITE_LUMI_API_KEY=abc123

🧪 Example Output

✅ Valid Case

✅ Environment variables are valid

❌ Missing Variables

Missing variables:
  - VITE_API_URL

⚠️ Extra Variables

Extra variables not in .env.example:
  - VITE_UNUSED_VAR

💡 Why Use This?

Environment issues are often discovered at runtime:

  • Undefined API URLs
  • Missing client URLs
  • Incorrect deployment configuration
  • Broken production builds

This tool shifts that validation to development time.

Useful for:

  • Next.js projects
  • Vite projects
  • Node APIs
  • CI/CD pipelines
  • Team onboarding

🛠 How It Works

  • Reads .env.example
  • Reads .env
  • Parses both using dotenv
  • Compares key existence (not value truthiness)
  • Reports structural mismatches

Empty values like:

API_KEY=

are treated as valid if the key exists.

🔄 Exit Codes

| Exit Code | Meaning | | --------- | ----------------------------------- | | 0 | Environment files match | | 1 | Missing or extra variables detected |

Example CI usage:

env-check && echo "Environment valid"

📌 Roadmap

Planned improvements:

  • --fix flag to auto-add missing keys
  • Custom file path support
  • Strict mode
  • Sorting suggestions
  • Formatting validation

👤 Author

Built by ReactMode.