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

enwire

v3.0.0

Published

Imports, exports, and rewires environment variables.

Readme

image

enwire

Tool for "re-wiring" environment variables.

  • Supports .json format
  • Supports .env format

Installation

npm install --global enwire

or use enwire without installation:

npx enwire
npx enwire --no-process -r HOME
cat package.json | npx enwire --pick name --no-process
cat .env | npx enwire --pick foo --no-process

dotenv-like Usage

Create a .env file with your env vars.

FOO=bar

Run your app with your env vars.

cat .env | enwire node app.js

Usage

Print all env vars.

enwire

Print selected env vars.

enwire --no-process --rewire HOME
# {"HOME": "..."}

Export in env var format.

enwire --no-process --rewire HOME --format env
# HOME="..."

Rewire env vars.

enwire --no-process --rewire HOME:TROLOLO
# {"TROLOLO": "..."}

Pass string as an env var.

echo Hello | enwire --raw --no-process
# {"ENWIRE": "Hello"}

Set custom name for string variable.

echo Hello | enwire --raw --no-process --name HELLO
# {"HELLO": "Hello"}

Populate env vars from JSON.

echo '{"db": "Test"}' | enwire --no-process
# {"db": "Test"}

Rewire JSON env vars.

echo '{"db": "Test"}' | enwire --no-process --rewire db:PGDATABASE --delete db
# {"PGDATABASE": "Test"}

Print project name.

cat package.json | enwire --no-process --pick name
# {"name": "enwire"}

Rewire nested keys from JSON.

cat package.json | enwire --no-process --no-merge --rewire scripts.test:TEST_CMD
# {"TEST_CMD": "./test.sh"}

Pass project name to printenv NAME script.

cat package.json | enwire --rewire name:NAME -- printenv NAME
# enwire

Pass env vars to yarn deploy script.

enwire --rewire AWS_PROFILE_PROD:AWS_PROFILE -- yarn deploy

Rewire environment variables.

db=Test enwire --rewire db:PGDATABASE -- printenv PGDATABASE
# Test

Evaluate arguments as JavaScript template strings.

HELLO=Hello enwire --eval -- echo "\${HELLO}, \${USER + '\!'}"
# Hello, user!

Prompt user to enter env var in console.

enwire --prompt TEST -- printenv TEST

Options

npx enwire --help

  • --delete, -d — environment variable to delete.
  • --eval, -e — evaluate CLI argumens as JS template strings.
  • --import, -i — import and merge extra .json and .env files into process env
  • --prompt, -p — prompt user to input variable in console if not set.
  • --rewire, -r — from-to mapping of environment variable, e.g. --rewire db:PGDATABASE.
  • --delete-rewired — if specified, rewired environment variables will be deleted.
  • --format — by default exports in JSON format, --format=env can be set to export in env var format.
  • --no-process — if specified, process environment variables will not be included.
  • --no-merge — don't merge JSON from STDIN into process.env.
  • --pick — specifies which keys to pick from JSON object provided through STDIN.
  • --help, -h — show usage info.
  • --version, -v — show enwire version.