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

@aarunyaapps/env-redact

v1.1.1

Published

Parse .env files and detect/redact sensitive values. CLI + library, zero dependencies. Browser + Node.js compatible.

Readme

@aarunyaapps/env-redact

Parse .env files and detect / redact sensitive values. Zero dependencies. Works in Node.js and the browser.

Detects 35+ secret patterns: API keys, tokens, passwords, connection strings, JWTs, private keys, and high-entropy values (Stripe, OpenAI, Anthropic, GitHub, AWS, Azure, GCP, Twilio, SendGrid, and more).

🖥️ Prefer a UI? The same engine powers the free browser tool at aarunyaapps.com/env-sanitizer — 100% client-side, nothing leaves your machine.

CLI

No install needed:

# Redact .env to stdout
npx @aarunyaapps/env-redact

# Generate a .env.example (keys only)
npx @aarunyaapps/env-redact --example --write .env.example

# CI guard: exit 1 if a file contains live secrets
npx @aarunyaapps/env-redact .env.production --check

Block secrets in CI

# .github/workflows/ci.yml
- name: Check for committed secrets in env files
  run: npx @aarunyaapps/env-redact .env.example --check

All options

| Option | Description | |---|---| | [file] | Input file (default .env, - for stdin) | | --example | Output keys only, all values stripped | | --check | Exit 1 if sensitive values found (CI mode) | | --write <file> | Write output to a file instead of stdout | | --placeholder <str> | Replacement text (default REDACTED) | | --json | JSON summary: { total, sensitive, keys } |

Library

npm install @aarunyaapps/env-redact
import { parseEnv, buildSanitized, buildExample, countSensitive } from "@aarunyaapps/env-redact"

const lines = parseEnv(envFileContent)

buildSanitized(lines)                          // DATABASE_URL=REDACTED
buildSanitized(lines, { placeholder: "***" })  // DATABASE_URL=***
buildExample(lines)                            // DATABASE_URL=
countSensitive(lines)                          // 4

API

  • parseEnv(content: string): EnvLine[] — parse into typed lines (blank | comment | entry | invalid); entries carry key, value, sensitive
  • buildSanitized(lines, { placeholder? }) — sensitive values replaced, everything else byte-identical
  • buildExample(lines) — all values stripped (for .env.example)
  • buildDiff(lines) — line-level diff of what would change
  • countSensitive(lines) / countTotal(lines)
  • isSensitiveKey(key) / isSensitiveValue(value) — use the detection heuristics directly

Supports KEY=value and KEY: value styles, //-commented-out secrets (// API_KEY=... is still flagged), and multi-line colon syntax.

Privacy

This package performs no network calls, no telemetry, no file access beyond what you pass it. The browser version runs entirely client-side.

License

MIT © Aarunya Apps