Socket
Book a DemoInstallSign in
Socket

envc

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

envc

Loads environment variables from dotenv files

latest
Source
npmnpm
Version
2.5.0
Version published
Weekly downloads
119
250%
Maintainers
2
Weekly downloads
 
Created
Source

envc Build Status NPM version NPM downloads LICENSE

Loads environment variables from .env files.

Inspired by dotenv by Brandon Keepers.

Usage

// `options` are optional
var env = require('envc')(options);

Options:

  • path: Path to the .env file [optional, default: cwd]
  • name: Name of the .env file [optional, default: '.env']
  • nodeenv: NODE_ENV [optional, default: process.env.NODE_ENV]
  • booleans: enable boolean parsing, [optional, default: false]
  • numbers: enable number parsing, [optional, default: false]
  • readonly: load and parse .env file only (i.e. does not modify process.env), [optional, default: false]
  • overwrite: allow process.env to overwrite file values [optional, default: false]

Inheritance

envc will try to load:

  • {name}
  • {name}.{NODE_ENV}
  • {name}.local

Interpolation

URL_HOST="vesln.com"
URL_PATH="index"
URL_FULL="http://${URL_HOST}/${URL_PATH}"
DOCKER_SERVICE=$(boot2docker ip):11211 # works on node 0.12+

Installation

npm install envc

License

MIT

FAQs

Package last updated on 20 Feb 2017

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