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

env-check-pro

v1.0.0

Published

A stylish and powerful environment variable validator for Node.js using Zod.

Readme

Are you tired of debugging your application only to find out you forgot to add a variable to your .env file? env-check-pro solves this problem by validating your environment variables at startup, providing beautiful, easy-to-read error messages in the terminal, and giving you 100% type safety.

✨ Why env-check-pro?

  • 🛡️ Type-safe: Built on top of Zod, giving you full autocomplete and type inference.
  • 🎨 Beautiful Developer Experience (DX): Uses picocolors to print highly readable, organized error logs to the terminal when validation fails.
  • 🚀 Fail Fast: Instantly stops process execution (process.exit(1)) on invalid environment variables.
  • 📦 Zero Config: Works right out of the box with CommonJS and ESModules.

🎨 Error Output Example

When an environment variable is missing or invalid, the console output looks like this. It is designed to be instantly readable:

✖ Environment variable validation failed!
  ► DATABASE_URL: Invalid URL
  ► PORT: Invalid string: must match pattern /^\d+$/
  ► API_KEY: API key must be at least 10 characters long

Please check your .env file or environment variables.

📦 Installation

npm install env-check-pro zod
# or
yarn add env-check-pro zod
# or
pnpm add env-check-pro zod

🚀 Usage Guide

Create a file where you define and export your validated environment variables (for e.g., src/env.ts):

import { validateEnv, z } from 'env-check-pro';

// 1. Define your schema using Zod
const envSchema = z.object({
  DATABASE_URL: z.string().url(),
  PORT: z.string().regex(/^\d+$/).transform(Number),
  NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
  API_KEY: z.string().min(10, 'API key must be at least 10 characters long'),
});

// 2. Validate process.env
// If it fails, it prints a beautiful error message and exits the process!
export const env = validateEnv(envSchema);

Then use it anywhere in your app with perfect auto-complete:

import { env } from './env';

console.log(`Server starting in ${env.NODE_ENV} mode...`);
console.log(`Database connected at ${env.DATABASE_URL}`);
// env.PORT is strictly typed as a Number!

⚙️ Advanced Options

You can pass an options object as the second argument to validateEnv:

const env = validateEnv(schema, {
  // Do not exit process (process.exit(1)) upon failure. Default is false.
  skipExit: true, 
  
  // Custom message printed when validation passes
  successMessage: '✅ All environment variables are ready!', 
  
  // Custom Object to validate against instead of process.env
  env: customEnvObject 
});

📄 License

MIT © Ahmet Ozcan