Skip to content

Repository files navigation

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.

Change log

Visit CHANGELOG.md

About

Loads environment variables from .json file

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages