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

@tomi_tom/envsync

v0.1.5

Published

Garde ton .env.example synchronisé avec ton .env et détecte les erreurs courantes. Zéro réseau, zéro dépendance runtime.

Downloads

854

Readme

envsync

Keep your .env.example in sync with your .env and catch common mistakes. Zero network, zero runtime dependencies.

The pain: you add a variable to .env, forget to add it to .env.example, and a teammate's app breaks on the next clone. envsync catches this drift in one command — ideal as a pre-commit hook or in CI.

Install & usage

Run it directly with npx (no install):

npx @tomi_tom/envsync            # check .env ⇄ .env.example in the current folder

Or install it globally to get the envsync command:

npm install -g @tomi_tom/envsync
envsync                      # = envsync check (compare .env ⇄ .env.example, lint, report)
envsync update               # (re)generate .env.example from .env, values blanked
envsync check --ci           # also fail on warnings (exit ≠ 0)
envsync check --json         # machine-readable JSON report (for CI / tooling)
envsync --env .env.local --example .env.example

Exit code 0 if everything is in order, 1 on drift/errors → pluggable into CI / git hooks.

With --json, the report is emitted as structured JSON (ok, diff, lint, secrets, summary) instead of the coloured text, so CI steps and custom reporters can parse results without scraping the human output.

What it detects

  • Drift: keys present in .env but absent from .env.example (and vice versa)
  • Duplicate keys (the "last wins" footgun)
  • Spaces around =, keys not in UPPER_SNAKE_CASE, unquoted spaced values
  • Sensitive keys (*_SECRET, *_TOKEN, API_KEY…) with a real value → reminder before commit

Stack & dev

Node + TypeScript, no runtime dependencies (homemade ANSI colors, node:util.parseArgs, node:fs). Tests: Vitest.

pnpm install
pnpm test         # 16 tests
pnpm build        # tsc → dist/
node dist/cli.js check --env fixtures/.env --example fixtures/.env.example

Architecture

src/
  parser.ts     # parse .env (tolerant, never throws) — pure logic, tested
  diff.ts       # drift .env ⇄ .env.example
  lint.ts       # common mistakes + secret detection
  generate.ts   # .env.example from .env (values blanked, deduplicated)
  format.ts     # colored terminal output (off when piped / NO_COLOR)
  cli.ts        # arg parsing + check/update commands

Differentiation

Existing .env linters (dotenv-linter…) target style/duplicates. envsync focuses on the .env.env.example synchronization workflow (the real team pain) plus an update mode that regenerates the example without leaking values. Free, local, dependency-free.