1.0.1 • Published 7 years ago

12g-cleandotenv v1.0.1

Weekly downloads
73
License
MIT
Repository
github
Last release
7 years ago

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.