npm.io
1.0.1 • Published 8 years ago

@eddiewen/dotenvjson

Licence
MIT
Version
1.0.1
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Stars
3

dotenvjson

npm version Dependency Status Standard Version CircleCI Coverage Status

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

# npm install --save @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
  • path

Default value: path.join(process.cwd(), '.env.json')

You can use a custom config file path.

  • inUpperCase

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.

Keywords