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

@saasak/tool-env

v1.1.0

Published

A small util to manage environment variables for your monorepo

Readme

Env management

Warnings

  • Make sure to have the git hook setup OR TO add any new variable viw the dedicated subcommand
  • Obviously do not commit your password file
  • In variable composition, the "static" parts are NOT encrypted (static part should never contain sensitive information)

Goals

  • Centralize env variables definitions
  • Allow explicit variables composition
  • Good DX (setup and forget)

TODOs

  • [x] Handle encryption
  • [ ] Fix not scoped package detection (if one package is not scope, it fails with pkg.name something)
  • [ ] Handle variable composition everywhere (not just in overrides)
  • [x] Create runtime library to read vars (even encrypted)
  • [x] Handle env.local files

Open questions

  • Should we write all the env with the next.js convention ?
  • How to handle adding a var easily in an encrypted context ?
  • Should we split BUILD / RUN variables ?

Examples

in package.json (root)

{
	"scripts": {
		"postinstall": "wrenv --secret ~/.big-secret write --target dev",
		"env:update": "wrenv --secret ~/.big-secret write"
	}
}

and then later

pnpm run env:update --target prod

or

WRENV_TARGET=staging bun run env:update

Writing all environments

Use --target all to write environment files for all configured environments at once. This creates suffixed files using conventional names (.env.development, .env.staging, .env.production) instead of a single .env file.

Internal names are mapped to conventional output names:

  • dev.env.development
  • preprod.env.staging
  • production.env.production
wrenv --secret ~/.big-secret write --target all

This is useful for:

  • CI/CD pipelines that need all environment configurations
  • Docker builds that copy environment-specific files
  • Pre-generating all env files for deployment
  • Compatibility with Next.js, Vite, and other frameworks that use conventional env file names

you can also pass the secret via an env variable (Even though it is not really encouraged)

WRENV_SECRET=super-secret WRENV_TARGET=prod npm run env:update

or via stdin

cat ~/.big-secret | wrenv --secret=stdin write --target=dev
wrenv --secret stdin --target=dev < ~/.big-secret

Git hooks

Wrenv provide a git hook (to be configured independently with the solution of your choosing) to encrypt all added variables So in .git/hooks/pre-commit you can add

bun run wrenv --secret ~/.big-secret besafe

This will run on the .env.json file and make sure all variables are encrypted. This way you can add new variables and make sure they don't leak, offering minimum friction.

/!\ You must make sure to add this hook OR to always add var via the dedicated subcommand wrenv add

Add a variable

To add a new variable use the add subcommand

wrenv --secret=~/.big-secret add NEW_VAR +fallback=@@_VALUE +dev=DEV_VALUE +production=PROD_VALUE