Yaml file to environment variables
Yaml file to environment variables. Based on https://github.com/jrwells/env-yaml
require('yaml-2-environment').config();
It loads a .env.yml
file in the root directory of your project, and parses to add as environment variables.
Example:
base_url: google.com.br
process.env.base_url: 'google.com.br'
Default: .env.yml
You can specify a custom path if your file containing environmnet variables is named or located differently.
require('yaml-2-environment').config({ path: '/custom/path/to/your/yaml/env/vars' });
Default: utf8
You may specify the encoding of your file containing environment variables
using this option.
require('yaml-2-environment').config({ encoding: 'base64' });
Default: null
You may specify a namespace in which to fetch your environment variables. Useful when you want to store environment specific values within the same files.
```javascript
require(‘yaml-2-environment’).config({ namespace: ‘development’ });