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

dsh-env-example-check

v0.2.3

Published

Env example hygiene: every key carries a placeholder rather than a real value, no committed credential, no duplicate key, and the file says what each key is for.

Readme

dsh-env-example-check

Env-example hygiene from one file. A committed .env.example is the contract every new contributor reads first, and it is decidable: every key carries a placeholder, no live credential shipped with it, no duplicate key silently overriding an earlier one, and the file says what each key is for.

前置要求

Node.js ≥ 22.19,就是 package.json 里 engines.node 写的那一条;CLI 只依赖 Node,别的不装也能跑。想在对话里用同一个检查,需要 DSH >=0.2.2-rc.1 <0.3.0-0。装之前 node -v 看一眼,比装完再猜为什么报错快。

跑通大概 2 分钟。卡住了在仓库开 issue,别自己啃。

真实输入输出

输入:

DATABASE_URL=postgres://user:pass@prod-db:5432/app
PORT=8080
API_KEY=sk-live-abc123

真实运行(逐字输出,由测试与工具保持同步):

$ env-example-check env-sample
error literal-value 第1行 第 1 行 DATABASE_URL 带了字面值「postgres://user:pass」——示例文件只放占位符,真值进 .env(不提交)
error literal-value 第2行 第 2 行 PORT 带了字面值「8080」——示例文件只放占位符,真值进 .env(不提交)
error literal-value 第3行 第 3 行 API_KEY 带了字面值「sk-live-abc123」——示例文件只放占位符,真值进 .env(不提交)
warn comment-missing 第0行 没有任何注释行——说明每个键的用途,读者才知道该填什么
fail: 3 keys, 3 errors, 1 warnings

出口码:1。

Listed in awesome-dsh-plugin.

What it decides

| rule | level | meaning | | --- | --- | --- | | empty | error | no KEY=value line at all | | literal-value | error | a key carries a real-looking value — the file was copied from .env | | duplicate-key | error | the same key twice; the later assignment wins silently, named with both lines | | line-unparsed | warn | a line that is not KEY=value and not a comment | | key-case | warn | a lowercase key — in a shell, port and PORT are two variables | | comment-missing | warn | no comment line at all (an error with --require-comment) |

Accepted placeholders: empty, <angle-bracketed>, ${VAR} references, your-…, changeme, xxx, TODO, placeholder, example, dummy, test, none, null. Anything else is a literal that shipped.

Use

npx dsh-env-example-check .env.example --json
npx dsh-env-example-check .env.example --require-comment

Same function over HTTP: POST /env-example-check/api with {"text": "…"} or {"path": "…"} — the CLI and the host route share one implementation, so they cannot disagree.

A documented example URL is a placeholder

Reserved example domains and loopback hosts count as placeholders: example.com, example.org, example.edu, *.test, *.invalid, localhost, 127.0.0.1. A documentation URL pointing at https://remote.example.edu/... is as much a placeholder as <your-host>.

Found on a real third-party .env.example: its only crime was documenting a URL on a reserved example domain, and this check called it a committed literal. A rule that flags correct documentation is a rule that gets the whole file deleted from CI rather than fixed.

Honest scope

This checks the example file's shape, not whether the real .env leaked: it cannot see your repository history, your CI secrets, or whether the placeholder is filled correctly. Run it in a pre-commit hook and in CI on the example file — it catches the copy-paste that ships a credential, which is the failure it exists for.