@deuterium/env

1.2.1 • Public • Published

@deuterium/env

A useful package for reading environmental variables.

Installation

yarn add @deuterium/env

Usage

Use of @deuterium/env returns a javascript object with all of the individual env objects in your .env file and beyond, as a result of use of read-env and dotenv.

For example, with a .env file containing:

WEB_PORT=8000

We have

import { WEB_PORT, NODE_ENV } from '@deuterium/env'

console.log(WEB_PORT) // 8000
console.log(NODE_ENV) // 'development'

If no NODE_ENV is defined, then it automatically sets it to development, otherwise defaults to set NODE_ENV. Also allows for testing of current environment with IN_DEV_ENV, IN_PROD_ENV, IN_TEST_ENV which default to true/false based on NODE_ENV.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.1
    1
  • 1.1.0
    0
  • 1.0.4
    0

Package Sidebar

Install

npm i @deuterium/env

Weekly Downloads

1

Version

1.2.1

License

MIT

Unpacked Size

2.96 kB

Total Files

6

Last publish

Collaborators

  • deuterium