envv-flow
v1.0.1
Published
A simple package to manage and switch between environment files.
Maintainers
Readme
🌊 Envv Flow -

Because who needs hardcoded .env files?
Welcome to Envv Flow, the tool that lets you swap out environment files as easily as changing your socks (well... almost). No more manual copy-pasting or git mishaps—just smooth sailing between local, staging, and production environments.
🚨 The Problem
You’ve got multiple environments—local, staging, production—and each one has its own .env file.
But your app keeps getting confused:
- One minute it’s connected to your local database...
- The next, it’s wreaking havoc in production. 😱
Enter Envv Flow — your new favorite way to manage and switch .env files effortlessly.
✅ The Solution
Envv Flow makes it easy to manage multiple .env files across environments.
When you run it, it simply takes the desired environment file—like .env.local, .env.stage, or .env.production—and copies its contents into your main .env file.
That’s it.
No more renaming files, no more manual copy-pasting—just a clean, consistent .env file ready for whatever environment you're working in. Just clean, controlled environment switching.
✨ Key Features
- 🔁 Environment Magic: Switch between
.env.local,.env.stg,.env.prod, or any custom.envfile with a single command. - 🧘 Zero Fuss: No more manual renaming or copy-pasting.
- ⚙️ Customizable: Define your own mappings in a simple
config.jsonfile. - 📦 Easy to Use: Works with any Node.js project. Just install it as a dev dependency.
📦 Installation
Install Envv Flow as a development dependency:
npm install --save-dev envv-flowPerfect — here's the updated 🛠️ Configuration section incorporating the new env-flow-init command, and guiding users through the rest.
🛠️ Configuration
To get started, just run:
npx env-flow-initThis will automatically create a config.json file in the root of your project with the following default content:
{
"local": ".env.local",
"stg": ".env.stage",
"prod": ".env.production"
}This file maps environment names to their corresponding .env files.
💡 You can customize this mapping however you like. Want to use
.env.devinstead of.env.local? No problem—just update the values inconfig.json.
For example:
{
"dev": ".env.dev",
"qa": ".env.qa",
"prod": ".env.prod"
}Env Flow will use this mapping whenever you run a switch command.
Thanks! Here's the updated Usage section reflecting your new command structure:
🚀 Usage
After setting up your config.json (using npx env-flow-init), you’re ready to flow through environments like a breeze. 🌬️
🔄 Switch Environments
npx env-flow switch <env-name>Example:
npx env-flow switch localThis copies the contents of .env.local (or whatever file is mapped in config.json) into your main .env file. ✅
📋 List Available Environments
npx env-flow listThis will output all available environment mappings from your config.json so you know exactly what you can switch to.
📌 Check Current Environment
npx env-flow statusThis shows which environment is currently active (based on the contents of .env and what it matches in your config).
📚 Example
Let’s say you have the following .env files:
.env.local
DB_HOST=localhost
DB_USER=root
DB_PASS=password.env.stage
DB_HOST=staging-db.example.com
DB_USER=stg_user
DB_PASS=stg_password.env.production
DB_HOST=prod-db.example.com
DB_USER=prod_user
DB_PASS=prod_passwordYou can switch to your local environment like this:
npx env-flow switch localAnd BAM! 🎉 Your .env is now loaded with local settings—ready to go.
❤️ Why You’ll Love It
- Tired of juggling multiple
.envfiles? ✔️ This solves it. - Nervous about pushing the wrong config to production? ✔️ Safe switching.
- Want more time coding, less time debugging config issues? ✔️ You’re welcome.
🙌 Contributing
Found a bug? Got an idea for a killer feature?
Please open an issue or submit a pull request. This project thrives on your feedback and contributions!
💭 Final Thoughts
If you’ve ever felt the frustration of managing .env files manually, Envv Flow is here to save the day.
Because life’s too short for environment variable drama.
Now go forth, switch with confidence, and let Envv Flow handle the work!
✍️ Author
Crafted with universe, keyboard rage, and just the right amount of “why isn’t this built-in already?” by cinfinit.
If this saved you from one more accidental .env.production mishap in local dev— you’re welcome. 😎
Feel free to send praise, bug reports, or memes. No feature requests on Mondays. 😉
