Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

env-accessors

wilmoore17MIT0.2.2

process.env accessor functions.

12factor, accessor, accessors, env, envc, environment, environments, variable, variables

readme

env-accessors

Build Status NPM version NPM downloads LICENSE

process.env accessor functions.

$ npm install env-accessors --save

API

.del

aliases: -

Delete given key from process.env.

del('DISABLED_SERVICES');
.get

aliases: -

Get given key's value from process.env.

get('DATABASE_NAME');
.has

aliases: contains

Whether process.env contains given key.

has('NEW_RELIC_LICENSE_KEY');
.missing

aliases: -

Whether given key is missing from process.env.

missing('NEW_RELIC_LICENSE_KEY');
.required

aliases: assert

Throw a ReferenceError if given key is missing from process.env and return given key's value from process.env otherwise.

required('NEW_RELIC_LICENSE_KEY');
.set

aliases: put

Set value for process.env[key].

set({ DATABASE_HOST: 'localhost' });

License

MIT

changelog

Change Log

All notable changes to this project will be documented in this file.

0.2.2 - 2018-01-17

Changed

  • .required and .assert throw a ReferenceError if given key is missing from process.env and return given key's value from process.env otherwise.
  • switch from faucet to tap-spec.

0.2.0 - 2014-12-15

Added

  • .contains (alias for .has)