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

multienv-loader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multienv-loader

A configurable dotenv loader for multiple environments

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
decreased by-49.18%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Coverage Status

Multienv Loader

A configurable .env file loader for multiple environments inspired by dotenv and vue-cli

Installation

yarn add multienv-loader
npm install multienv-loader

Usage

At the top of your entry file:

require('multienv-loader').load() // or load(options)

Or directly from terminal (without options):

node -r multienv-loader/load your_script.js
Options
  • options.mode: Environment mode. Defaults to process.env.NODE_ENV
  • options.envPath: Location of dotenv files. Defaults to process.cwd()
  • options.envFiles: Array of dotenv filenames to load in order. Defaults to ['.env', '.env.[mode]', '.env.local', '.env.[mode].local']
  • options.dry: Does not modify process.env. Defaults to false
  • options.override: Existing variables in process.env will be overriden by the dotenv files. Defaults to false
  • options.filter: Function that gets a variable name as first argument and returns whether or not it should be loaded. Defaults to () => true
# Local Env Files
.env.local
.env.*.local
Other

Internal functions like parse or safeLoad are also exposed.

License

MIT

Keywords

FAQs

Package last updated on 28 Feb 2020

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