Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

maxbeatty/dotenv-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotenv-json

Load environment variables via a JSON file

npm install dotenv-json

Define your environment variables in .env.json in the root of your project (or wherever you start your node process):

{
  "public_api_key": "s@Mpl3_d@Ta"
}

Load your environment variables at the beginning of your program:

require("dotenv-json")();

console.log(process.env.public_api_key) // => s@Mpl3_d@Ta

N.B. Existing keys in process.env will not be overwritten.

You can customize the location of your .env.json file by passing a path option:

const dotenvJSON = require("dotenv-json");
dotenvJSON({ path: "./config/example.json"});

About

Load environment variables via a JSON file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published