@artsy/multienv
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Artsy Multienv

Load multiple dotenv style environment files

Install

# with npm
npm install @artsy/multienv

# or with Yarn
yarn add @artsy/multienv

Usage

As early as possible in your application, require and configure dotenv.

import { loadEnvs } from '@artsy/multienv'

Create some .env files in the root directory of your project. Add environment-specific variables on new lines in the form of NAME=VALUE. For example:

db.env

DB_HOST=localhost
DB_USER=root
DB_PASS=s1mpl3

redis.env

REDIS_HOST=localhost
REDIS_USER=root
REDIS_PASS=s1mpl3
loadEnvs('db.env', 'redis.env')

process.env now has the keys and values you defined in your .env files.

Package Sidebar

Install

npm i @artsy/multienv

Weekly Downloads

122

Version

1.2.0

License

MIT

Unpacked Size

6.44 kB

Total Files

9

Last publish

Collaborators

  • joeyaghion
  • artsy-engineering
  • damassi
  • anandaroop
  • mzikherman
  • dblandin