Socket
Socket
Sign inDemoInstall

envoodoo

Package Overview
Dependencies
3
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

envoodoo

Environment variable loader


Version published
Weekly downloads
230
decreased by-75.79%
Maintainers
1
Install size
44.9 kB
Created
Weekly downloads
 

Readme

Source

Build Status

Coverage Status

NPM

Media Suite

envoodoo

Environment variable loader

The 'env voodoo' under the hood is node streams! (FTW)

Description

This module loads environment files into process.env for you. By default it looks for a .env file in your project root but you can pass in a path to any other files you might wish to load environment variables from.

Usage

Basic usage examples

Loading a .env file in the root of the project

require('envoodoo')()

Loading a file somewhere else

var envoodoo = require('envoodoo')
envoodoo('path/to/.env')
// or
envoodoo('path/to/.env', function(err) {
  // do something
})

Loading multiple files

var envoodoo = require('envoodoo')
envoodoo() //loads default .env
envoodoo('path/to/file1')
envoodoo('path/to/file2')

.env files

envoodoo generally handles simple KEY=VALUE .env files.

However, note the following:

  • KEY='VALUE' is acceptable
  • KEY="VALUE" is acceptable
  • export KEY=VALUE is also acceptable, envoodoo will strip the export from the start
  • comments using a hash (#) - are acceptable and will be ignored by envoodoo
  • empty lines - are acceptable and will be ignored by envoodoo
Example .env file
# My .env file

# user information
NAME=bob
AGE=31

# using export keyword
export ANIMAL=cat

# crazy key strings with weird characters
KEY1='12@3$%^asd'
KEY2="12@3$%^asd"

If this file were to be loaded with envoodoo, then:

process.env.NAME   === 'bob'
process.env.AGE    === '31'
process.env.ANIMAL === 'cat'
process.env.KEY1   === '12@3$%^asd'
process.env.KEY2   === '12@3$%^asd'

Keywords

FAQs

Last updated on 11 Jun 2015

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc