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

@vtx-labs/envjoy

v0.1.0

Published

Zero-config CLI that keeps your .env in sync with .env.example — finds missing, extra, and empty keys, and fixes them.

Readme

██╗   ██╗████████╗██╗  ██╗  ██╗      █████╗ ██████╗ ███████╗
██║   ██║╚══██╔══╝╚██╗██╔╝  ██║     ██╔══██╗██╔══██╗██╔════╝
██║   ██║   ██║    ╚███╔╝   ██║     ███████║██████╔╝███████╗
╚██╗ ██╔╝   ██║    ██╔██╗   ██║     ██╔══██║██╔══██╗╚════██║
 ╚████╔╝    ██║   ██╔╝ ██╗  ███████╗██║  ██║██████╔╝███████║
  ╚═══╝     ╚═╝   ╚═╝  ╚═╝  ╚══════╝╚═╝  ╚═╝╚═════╝ ╚══════╝

envjoy

Keep your .env in sync with .env.example.

npm CI License: MIT Zero dependencies


Add a key to .env, forget to update .env.example, and your teammate's app breaks on boot. envjoy compares the two files you already keep and tells you exactly what drifted — missing, empty, or extra keys. No schema, no config, no accounts.

$ npx @vtx-labs/envjoy

✗ Missing 2 (in example, not in env)
    - STRIPE_SECRET_KEY
    - REDIS_URL
● Empty 1 (present but no value)
    ○ DATABASE_URL
+ Extra 1 (in env, not in example)
    + DEBUG_FLAG

4 ok · run `envjoy --fix` to add missing keys · `--check` for CI

Quick start

npx @vtx-labs/envjoy            # report drift (no install)
envjoy --fix                    # scaffold missing keys into .env
envjoy --check                  # exit non-zero on drift (CI / pre-commit)
envjoy --generate               # create .env.example from .env, values stripped

Or add it to a project: pnpm add -D @vtx-labs/envjoy

Why not dotenv / env-schema / dotenv-safe?

Those load variables or validate against a schema you hand-write. envjoy validates against the .env.example your team already maintains — nothing extra to keep in sync, and zero runtime dependencies.

CLI

envjoy [options]

  -e, --env <file>       Env file to check        (default: .env)
  -x, --example <file>   Source of truth          (default: .env.example)
      --fix              Append missing keys to the env file (placeholders)
      --check, --ci      Exit non-zero on drift; makes no changes
      --generate         Write <example> from <env>, with values stripped
  -f, --force            Allow --generate to overwrite an existing example
      --no-extra         Ignore keys in env but not in example
      --no-empty         Ignore empty values in env
      --ignore <keys>    Comma-separated keys to skip (e.g. NODE_ENV,PORT)
  -h, --help             Show help
  -v, --version          Show version

| Exit code | Meaning | | :-------- | :--------------------------------------------------- | | 0 | In sync, or a non---check command succeeded | | 1 | Drift (or duplicate keys) detected in --check mode | | 2 | Usage error or a required file was not found |

# .github/workflows/ci.yml — fail the build if .env drifts
- run: npx @vtx-labs/envjoy --check --no-empty

Programmatic API

The library half is pure and dependency-free.

import { diffEnv } from "@vtx-labs/envjoy";
import { readFileSync } from "node:fs";

const diff = diffEnv(
  readFileSync(".env.example", "utf8"),
  readFileSync(".env", "utf8"),
  { ignore: ["NODE_ENV"] },
);

if (!diff.inSync) console.error("Drift:", { ...diff });

| Export | Description | | :----------------------------------- | :-------------------------------------------------- | | diffEnv(example, actual, options?) | Compare two env strings → EnvDiff | | applyMissing(example, actual) | Env content with missing keys appended | | generateExample(actual) | Build an example (values stripped) from an env | | parseEnv(content) | dotenv-compatible parser → entries, map, duplicates |

How it works

envjoy parses both files with a dotenv-compatible parserexport prefixes, single/double/back-quoted and multiline values, \n/\t escapes, inline and full-line # comments, CRLF, and a UTF-8 BOM — then does a set comparison. Malformed lines are skipped, never fatal. --fix only ever adds missing keys using the example's placeholders; it never copies real values.

License

MIT © VTX Labs