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

@hochej/envwise

v0.1.8

Published

Classify environment variables into safe, mapped secret, and dropped secret sets.

Downloads

264

Readme

envwise

envwise classifies environment variables into three groups:

  • mapped secrets: secret + known host(s)
  • dropped secrets: secret-like but no host mapping
  • safe vars: not classified as secret

Primary use is as a TypeScript library. A CLI is also included for local inspection.

Library usage

import { classify, classifyEnv } from "@hochej/envwise";

classify("GITHUB_TOKEN", "ghp_...");
// => { isSecret: true, hosts: ["api.github.com"], matchedBy: "value", ... }

classifyEnv(process.env as Record<string, string>);
// => { secrets: [...], dropped: [...], safe: [...] }

import { parseDotenv } from "@hochej/envwise";

parseDotenv("API_HOST=api.example.com\nAPI_URL=https://${API_HOST}\n");
// => interpolation disabled by default

parseDotenv("API_HOST=api.example.com\nAPI_URL=https://${API_HOST}\n", { expand: true });
// => enable dotenv-expand interpolation (opt-in)

Matching order

  1. overrides[name]
  2. value regex (value_patterns)
  3. exact name map (exact_name_host_map)
  4. keyword name map (keyword_host_map, longest keyword wins)
  5. generic secret-name pattern (KEY|TOKEN|SECRET|PASSWORD|...)

If value and name both match, value wins. If value matches but has no host mapping, name mapping is used as fallback.

CLI usage

# inspect current process env
envwise inspect --env

# inspect dotenv file
envwise inspect --file .env

# opt-in dotenv variable interpolation (can be slow on very large files)
envwise inspect --file .env --expand

# machine-readable output (secret values redacted by default)
envwise inspect --file .env --json

# include plaintext secret values (dangerous; use with care)
envwise inspect --file .env --json --include-secret-values

Optional integration helper

For consumers that need a Record<name, { hosts, value }> shape, use:

import { classifyEnvForGondolin } from "@hochej/envwise";

const { secretsMap } = classifyEnvForGondolin(process.env as Record<string, string>);

Development

envwise ships with a bundled mapping file (src/generated/secret-mapping.ts). End users do not need to run mapping update tooling.

Raw secret-mapping.gondolin.json/.sha256 files are not stored in this repo; CI fetches from hochej/hogwash when regenerating the bundled module.

# prereq: install uv (https://docs.astral.sh/uv/)
pnpm install

# maintainer workflow: pull latest mapping from hogwash via GitHub API
pnpm mapping:update -- --latest
# optional integrity pin: pnpm mapping:update -- --tag vX.Y.Z --sha256 <expected_sha>

pnpm fixtures:curate
pnpm fixtures:check
pnpm test
pnpm typecheck
pnpm build

Maintainer tooling uses uv to run Python scripts (in CI and package scripts).