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

@kevinpatil/envguard

v1.1.0

Published

CLI tool that validates .env files against .env.example before your app ships

Readme

@kevinpatil/envguard

License: MIT CI npm version npm downloads

Validate your .env file against .env.example before your app ships.

Catches missing keys, insecure defaults, type mismatches, weak secrets, and more — in a single fast command.

$ npx @kevinpatil/envguard

envguard — checking .env against .env.example

ERRORS (2)
  ✗ DATABASE_URL — Missing required key (defined in .env.example)
  ✗ JWT_SECRET — Insecure placeholder value: 'secret'

WARNINGS (2)
  ⚠ PORT — Expected a number but got 'abc'
  ⚠ STRIPE_KEY — Key is not declared in .env.example

2 error(s) found. Fix them before deploying.

Install

npm install --save-dev @kevinpatil/envguard

Or run without installing:

npx @kevinpatil/envguard

Usage

# Validate .env against .env.example in the current directory
npx @kevinpatil/envguard

# Target a specific env file
npx @kevinpatil/envguard --env .env.production

# Use a custom example file
npx @kevinpatil/envguard --example .env.example.production

# Exit with code 1 if any errors are found (for CI)
npx @kevinpatil/envguard --strict

# Output results as JSON
npx @kevinpatil/envguard --json

Validation Rules

| Rule | Severity | Description | |---|---|---| | missing-key | ERROR | Key defined in .env.example is absent from .env | | empty-value | ERROR | Key is present but has no value | | insecure-defaults | ERROR | Value matches a known insecure placeholder (changeme, secret, todo…) | | undeclared-key | WARNING | Key exists in .env but is not in .env.example | | weak-secret | WARNING | Secret key is under 16 characters | | type-mismatch | WARNING | Numeric key (PORT, TIMEOUT…) has a non-numeric value | | malformed-url | WARNING | URL key has a value with a missing or unrecognized protocol | | boolean-mismatch | WARNING | Boolean key (FEATURE_*, ENABLE_*…) has a non-boolean value |


CI Integration

Add envguard to your pipeline to block deployments with bad config:

GitHub Actions

- name: Validate environment variables
  run: npx @kevinpatil/envguard --strict

Any CI

npx @kevinpatil/envguard --strict  # exits with code 1 if errors are found

JSON output for custom pipelines

npx @kevinpatil/envguard --json | jq '.[] | select(.severity == "error")'

How it works

  1. Reads .env.example as the source of truth
  2. Reads your .env file
  3. Runs all validation rules against both
  4. Prints a color-coded report to the terminal
  5. In --strict mode, exits with code 1 if any errors are found

No config files required. No API keys. Works offline, in Docker, everywhere.


Contributing

See CONTRIBUTING.md.


License

MIT © Kevin Patil