dotenvjson
This is a module to load .json file, like config.json
, and export variables to process.env
. Inspired by dotenv.
Installation
$ yarn add @eddiewen/dotenvjson
Usage
Create a .env.json
file in the root folder of your project.
const dotenvjson = require('@eddiewen/dotenvjson');
dotenvjson();
And you get process.env
now.
Options
Default value: path.join(process.cwd(), '.env.json')
You can use a custom config file path.
Default value: true
You don't have to use upper case in config file. Parser transforms them to upper case if this is true. Or spelling names would be kept.