This package emulates the behavior of figaro for rails. It loads environment variables from an application.yml
file into process.env
.
In ./config/application.yml
:
SOME_VAR: 'FOO'
development:
IS_DEV: true
production:
IS_PROD: true
In your start script:
const Figaro = require('figaro-js')
Figaro.load()
console.log(process.env.SOME_VAR) // -> 'FOO'
Using ES6 syntax:
import * as Figaro from 'figaro-js'
Figaro.load()
console.log(process.env.SOME_VAR) // -> 'FOO'
Full module API and usage info can be found in docs.md.