figaro-js
v3.0.2
Published
Env variable management in JS
Downloads
675
Readme
figaro-js
This package emulates the behavior of figaro for rails. It loads environment variables from an application.yml
file into process.env
.
Quickstart
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'
Documentation
Full module API and usage info can be found in docs.md.