12g-cleandotenv

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i 12g-cleandotenv

Weekly Downloads

13

Version

1.0.1

License

MIT

Last publish

Collaborators

  • aapit