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

@tigerbook/check-env

v0.2.5

Published

Validates required environment variables declared in .env.example

Readme

check-env

npm license

Validates that all required environment variables declared in .env.example are configured in the current environment. Secrets are masked, type hints are validated, and missing vars are reported clearly.

Install

Global

Installs check-env as a system-wide command.

# pnpm or bun (recommended — PATH is configured automatically)
pnpm add -g @tigerbook/check-env
bun add -g @tigerbook/check-env

# npm
npm install -g @tigerbook/check-env

npm PATH note: If check-env is not found after install, run npm config get prefix to find the global bin directory and add <prefix>/bin to your PATH.

Per-project

Install as a dev dependency and run via npx / bunx, or wire up to package.json scripts.

pnpm add -D @tigerbook/check-env
# or
npm install --save-dev @tigerbook/check-env
// package.json
"scripts": {
  "predev": "check-env",
  "prestart": "check-env -e prod -s"
}

Requirements: Node >= 22 or Bun >= 1.0

Quick start

# Add to your project
echo "DB_HOST=\nDB_PORT=5432\nSTRIPE_SK=<secret>" > .env.example

# Run check
check-env

Output:

✓  DB_HOST    localhost    # .env.local
✓  DB_PORT    5432         # .env
✗  STRIPE_SK  (not set)

Exit code 0 on success, 1 on missing or invalid vars.

Usage

check-env                        # standard check (dev environment)
check-env -e prod                # check production environment
check-env -e staging             # check custom environment
check-env -v                     # verbose: show section titles
check-env -q                     # quiet: symbol + key name only
check-env -s                     # silent: no output on success, errors on failure
check-env -m                     # list only missing/invalid vars

Subcommands

# Print configured values as KEY=VALUE
check-env get                    # all vars
check-env get DB_HOST DB_PORT    # specific keys
check-env get --json             # JSON format
env $(check-env get) node app.js # inject into subprocess

# Reconstruct full .env from example + actual values
check-env dump                   # to stdout
check-env dump -o .env.snapshot  # to file

# Show .env.example format reference
check-env explain

.env.example format

# ── Database ──────────────────────────────
DB_HOST=                         # required
DB_PORT=5432                     # required, inferred and validated as number
PORT=<number>                    # required, validated as number at runtime
API_URL=<url>                    # required, validated as URL
STRIPE_SK=<secret>               # required, masked in output
API_KEY=                         # auto-detected as secret by name (KEY/TOKEN/SECRET/PASSWORD)
TIMEOUT=30  # default: 30          # default is inferred as number; not reported as missing

# Optional variables (commented out = not required)
# FEATURE_FLAG=false
# WEBHOOK_URL=<url>

Types are inferred from explicit <number> / <boolean> / <url> markers first, then from default: X, then from numeric, boolean, or URL example values. Plain strings are not assigned a type.

Run check-env explain for a full annotated reference.

Environment file priority

| Environment | Files loaded (low → high priority) | | --------------- | --------------------------------------------------------------------- | | dev (default) | .env.env.local.env.development.env.development.local | | prod | .env.env.production.env.production.local | | <custom> | .env.env.<name>.env.<name>.local |

Options

Global:
  -h, --help            Show help
  -e, --env <name>      Environment (default: dev)
  -E, --example <path>  Path to .env.example (default: .env.example)
  --no-color            Disable color output

Check modes:
  -v, --verbose         Show values, source files, and section titles
  -q, --quiet           Symbol + key name only
  -s, --silent          No output on success; list errors on failure
  -m, --mismatch        List only missing vars and type errors
  --no-mask             Show secret values unmasked

get:
  --json                JSON output instead of KEY=VALUE

dump:
  -o, --output <file>   Write to file instead of stdout

License

MIT