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

@raphaellcs/env-manager

v1.0.0

Published

Manage environment variables with ease

Readme

@raphaellcs/env-manager

A simple and powerful tool for managing environment variables with ease.

Features

  • 📋 List all environment variables
  • 🔍 Get specific variables
  • ✏️ Set new variables
  • 🗑️ Remove variables
  • 📄 Validate environment file format
  • 📋 Copy variables between files
  • 🔒 Mask sensitive values by default

Installation

# Use with npx (no installation needed)
npx @raphaellcs/env-manager --help

# Or install globally
npm install -g @raphaellcs/env-manager

Usage

List Environment Variables

# List all variables from .env file
npx @raphaellcs/env-manager list

# List from custom file
npx @raphaellcs/env-manager list --file config.env

# Include system environment variables
npx @raphaellcs/env-manager list --all

Get a Specific Variable

# Get a variable
npx @raphaellcs/env-manager get DB_HOST

# Get from custom file
npx @raphaellcs/env-manager get API_KEY --file .env.production

# Show raw value without masking
npx @raphaellcs/env-manager get PASSWORD --raw

Set a Variable

# Set a new variable
npx @raphaellcs/env-manager set DB_HOST localhost

# Set in custom file
npx @raphaellcs/env-manager set NODE_ENV production --file .env.production

Remove a Variable

# Remove a variable
npx @raphaellcs/env-manager unset DB_HOST

# Remove from custom file
npx @raphaellcs/env-manager unset API_KEY --file .env.test

Initialize .env File

# Create a new .env file with template
npx @raphaellcs/env-manager init

# Create with custom name
npx @raphaellcs/env-manager init --file .env.example

Copy Variables Between Files

# Copy from .env.example to .env
npx @raphaellcs/env-manager copy .env.example .env

# Copy and overwrite existing variables
npx @raphaellcs/env-manager copy .env.example .env --overwrite

Validate Environment File

# Validate .env file
npx @raphaellcs/env-manager validate

# Validate custom file
npx @raphaellcs/env-manager validate --file .env.production

Examples

Example 1: List All Variables

$ npx @raphaellcs/env-manager list

📋 Environment Variables (.env):

  DB_HOST = lo****st
  DB_PORT = 54****
  DB_NAME = my**
  DB_USER = po*******e
  DB_PASSWORD = pa******re

$ npx @raphaellcs/env-manager list --all

📋 Environment Variables (.env):

  DB_HOST = lo****st
  DB_PORT = 54****

System Environment Variables:

  NODE_ENV = de********ent
  HOME = /h**e/l

Example 2: Create and Set Variables

$ npx @raphaellcs/env-manager init
✓ Created .env
Edit the file and add your environment variables.

$ npx @raphaellcs/env-manager set DB_HOST localhost
✓ Set DB_HOST successfully

$ npx @raphaellcs/env-manager set API_KEY secret123
✓ Set API_KEY successfully

Example 3: Get Variables

$ npx @raphaellcs/env-manager get DB_HOST
localhost

$ npx @raphaellcs/env-manager get API_KEY
se****23

$ npx @raphaellcs/env-manager get API_KEY --raw
secret123

Example 4: Validate File

$ npx @raphaellcs/env-manager validate
✔ File is valid

$ npx @raphaellcs/env-manager validate
  Line 5: Missing '=' separator
  Line 8: Spaces in key name
⚠ File is valid with 1 error(s) and 1 warning(s)

Example 5: Copy Variables

$ npx @raphaellcs/env-manager copy .env.example .env
✓ Copied 8 variable(s) to .env

$ npx @raphaellcs/env-manager copy .env.example .env --overwrite
✓ Copied 12 variable(s) to .env

Best Practices

1. Never Commit .env Files

Add .env to your .gitignore:

.env
.env.local
.env.*.local

2. Use .env.example

Create a template file:

npx @raphaellcs/env-manager init --file .env.example

Commit this file so others know which variables are needed.

3. Use Different Files for Different Environments

# Development
.env

# Staging
.env.staging

# Production
.env.production

4. Reference Variables in Code

// In Node.js
require('dotenv').config();

const dbHost = process.env.DB_HOST;
const apiKey = process.env.API_KEY;

Security Tips

  • ❌ Never commit .env files
  • ✅ Use .env.example as a template
  • 🔒 Rotate sensitive keys regularly
  • 📋 Use different files for different environments
  • 🚫 Don't include .env in backups
  • 🔑 Use strong passwords and keys

Common Use Cases

Development Setup

# 1. Create .env.example
npx @raphaellcs/env-manager init --file .env.example

# 2. Team member creates their own .env
npx @raphaellcs/env-manager init

# 3. Set variables
npx @raphaellcs/env-manager set DB_HOST localhost
npx @raphaellcs/env-manager set NODE_ENV development

Deployment

# 1. Copy from example to production
npx @raphaellcs/env-manager copy .env.example .env.production

# 2. Set production values
npx @raphaellcs/env-manager set NODE_ENV production --file .env.production
npx @raphaellcs/env-manager set API_KEY production_key --file .env.production

# 3. Validate before deploy
npx @raphaellcs/env-manager validate --file .env.production

Configuration Management

# Check current configuration
npx @raphaellcs/env-manager list

# Verify specific values
npx @raphaellcs/env-manager get DB_HOST

# Update configuration
npx @raphaellcs/env-manager set DB_PORT 5432

# Remove unused variables
npx @raphaellcs/env-manager unset DEBUG

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

License

MIT

Author

Dream Heart 🌙

Links