0.1.4 • Published 5 years ago

dotenv-yaml v0.1.4

Weekly downloads
1,498
License
-
Repository
github
Last release
5 years ago

dotenv-yaml

Usage

As early as possible in your application, require and configure dotenv-yaml.

require('dotenv-yaml').config();

Preload

You can use the --require (-r) command line option to preload dotenv-yaml. By doing this, you do not need to require and load dotenv-yaml in your application code.

$ node -r dotenv-yaml/config your_script.js

The configuration options below are supported as command line arguments in the format dotenv_yaml_config_<option>=value

$ node -r dotenv-yaml/config your_script.js dotenv_yaml_config_path=/custom/path/to/your/env/vars dotenv_yaml_config_encoding=utf8

Create a .env.yml file in the root directory of your project, and add environment-specific variables as valid YAML.

That's it.

process.env now has the keys and values you defined in your .env.yml file.

Options

Path

Default: .env.yml

You can specify a custom path if your file containing environmnet variables is named or located differently.

require('dotenv-yaml').config({ path: '/custom/path/to/your/yaml/env/vars' });

Encoding

Default: utf8

You may specify the encoding of your file containing environment variables using this option.

require('dotenv-yaml').config({ encoding: 'base64' });
0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago