Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dotenv-flow

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotenv-flow

Loads environment variables from `.env.[development|test|production][.local]` files

  • 4.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
711K
increased by8.08%
Maintainers
1
Weekly downloads
 
Created

What is dotenv-flow?

dotenv-flow is an npm package that extends the functionality of dotenv by adding support for multiple environments and cascading .env files. It allows you to manage environment variables for different stages of your application (e.g., development, testing, production) more effectively.

What are dotenv-flow's main functionalities?

Load environment variables from multiple .env files

This feature allows you to load environment variables from multiple .env files based on the current NODE_ENV. For example, if NODE_ENV is set to 'development', it will load variables from .env, .env.development, and .env.local.

const dotenvFlow = require('dotenv-flow');
dotenvFlow.config();
console.log(process.env.MY_VARIABLE);

Cascading .env files

Cascading .env files means that variables from .env files specific to the environment (e.g., .env.development) will override those in the base .env file. This allows for environment-specific configurations while maintaining a base set of variables.

const dotenvFlow = require('dotenv-flow');
dotenvFlow.config();
console.log(process.env.MY_VARIABLE);

Support for .env.local files

dotenv-flow supports .env.local files which can be used to override variables in the base and environment-specific .env files. This is useful for local development settings that should not be committed to version control.

const dotenvFlow = require('dotenv-flow');
dotenvFlow.config();
console.log(process.env.MY_VARIABLE);

Other packages similar to dotenv-flow

Keywords

FAQs

Package last updated on 26 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc