0.2.0 • Published 2 years ago

@fabianbru/env v0.2.0

Weekly downloads
12
License
MIT
Repository
github
Last release
2 years ago

@fabianbru/env

Loads and validates environment variables from .env file.

Install

npm install @fabianbru/env

Usage

.env file in project root:

API_KEY=123secret456

env.js file in project root:

const { Joi } = require('@fabianbru/env')

module.exports = {
  API_KEY: Joi.string().required(),
}

Somewhere in your project:

const { env } = require('@fabianbru/env')

console.log(env.API_KEY)

Validation

Validation is done via joi. See API documentation.

0.2.0

2 years ago

0.1.0

3 years ago

0.1.1

3 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago