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

Package detail

12g-cleandotenv

grrr-amsterdam68MIT1.0.1

This package enables you to load .env files and return their values as an object.

env, dotenv, 12factor, configuration

readme

12g-cleandotenv

This package enables you to load .env files and return their values as an object.

It cleans out:

  • Comment lines
  • Single or double quotes from values

Usage

const dotenv = require('12g-cleandotenv')

dotenv.load()
.then(vars => {
    console.log(vars)
})

Methods

.load([path])

Loads a .env file and returns the cleaned up variables in an object, as a Promise.

.clean(input)

Cleans up the content of a .env file and returns the variables in an object. The env file content input can be a string or an object.