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 πŸ™

Β© 2025 – Pkg Stats / Ryan Hefner

@crabest/envguard

v0.1.1

Published

πŸ›‘οΈ Validate .env files and manage multiple environments with auto-sync

Downloads

9

Readme

EnvGuard πŸ›‘οΈ

npm version License: MIT

A powerful CLI tool that validates .env files against .env.example files and manages multiple environment configurations with ease.

✨ Features

βœ… Environment Validation: Compare .env files against .env.example templates
🌍 Multi-Environment Management: Manage multiple environments using .envguard/ directory
πŸ”„ Auto-Sync: Automatically saves .env changes to the active environment
🎯 Easy Switching: Quickly switch between development, staging, production, etc.
πŸš€ Fast & Reliable: Built with Go for speed and reliability
πŸ“Š Detailed Reports: Clear summaries showing missing, extra, and valid variables

πŸ“¦ Installation

Global Installation (Recommended)

npm install -g @crabest/envguard

Local Installation

npm install @crabest/envguard

πŸš€ Quick Start

# 1. Create your first environment
envguard create -e development --from-current

# 2. Create additional environments
envguard create -e staging
envguard create -e production --from-current

# 3. List all environments
envguard list

# 4. Use environments - edit .env normally!
envguard use production
# Edit .env in your editor...
envguard use development  # Previous changes auto-saved!

# 5. Check current environment status
envguard status

# 6. Validate current environment
envguard

# 7. Clean up unused environments
envguard delete -e old-staging

πŸ“‹ Available Commands

| Command | Description | Auto-Sync | Example | |---------|-------------|-----------|---------| | envguard | Validate .env against .env.example | βœ… | envguard | | envguard use <env> | Use environment + track | βœ… | envguard use production | | envguard status | Show active environment | βœ… | envguard status | | envguard create -e <env> | Create new environment | βœ… | envguard create -e staging | | envguard list | List all environments | βœ… | envguard list | | envguard delete -e <env> | Delete environment | ❌ | envguard delete -e old-env |

🎯 Example Output

πŸ” EnvGuard - Environment File Validator

πŸ“Š Validation Results:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
πŸ“ Comparing: .env ↔ .env.example

βœ… Variables found in both files (8):
   βœ“ DATABASE_URL
   βœ“ API_KEY
   βœ“ PORT
   βœ“ JWT_SECRET

⚠️  Missing variables in .env (2):
   β€’ EMAIL_SERVICE_KEY
   β€’ WEBHOOK_SECRET

πŸ“ˆ Summary:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
πŸ“Š βœ… 8 variables OK β€’ ⚠️ 2 missing

🌍 Platform Support

EnvGuard supports the following platforms:

  • macOS (Intel & Apple Silicon)
  • Linux (x64)
  • Windows (x64)

πŸ“ How It Works

  • .envguard/ Directory: All environment files are stored in this hidden directory
  • Active Environment: The root .env file is always your active environment
  • Auto-Sync: Any changes to .env are automatically saved to the active environment
  • Environment Usage: envguard use copies the selected environment to .env
  • Active Tracking: envguard use tracks the current environment in .envguard/.active
  • Status Checking: envguard status shows which environment is currently active
  • Validation: Always validates the active .env against .env.example
  • Isolation: Each environment is completely isolated and independent

πŸ› οΈ Development Workflow

# Set up your project environments
envguard create -e development --from-current
envguard create -e staging 
envguard create -e production --from-current

# Work with different environments - edit .env normally!
envguard use development     # Switch to development
# Edit .env in your favorite editor...
envguard status             # Auto-saves changes, shows current environment
envguard                    # Auto-saves changes, validates environment

envguard use production     # Auto-saves dev changes, switches to production
envguard status             # Confirm you're in production
envguard                    # Validate before deployment

πŸ› Troubleshooting

Permission Issues (macOS/Linux)

# If you get permission errors, run:
chmod +x $(which envguard)

Reinstallation

# If something goes wrong, try:
npm uninstall -g @crabest/envguard
npm install -g @crabest/envguard

Platform Not Supported

If you get an "Unsupported platform" error, EnvGuard currently supports:

  • macOS (darwin)
  • Linux
  • Windows (win32)

πŸ“ License

MIT License - see LICENSE file for details.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ”— Links