Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/launchpadlab/figaro-js
Env variable management in JS
https://github.com/launchpadlab/figaro-js
Last synced: 3 days ago
JSON representation
Env variable management in JS
- Host: GitHub
- URL: https://github.com/launchpadlab/figaro-js
- Owner: LaunchPadLab
- License: mit
- Created: 2018-01-29T22:00:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-09T08:55:49.000Z (6 months ago)
- Last Synced: 2024-10-28T10:01:24.046Z (11 days ago)
- Language: JavaScript
- Size: 218 KB
- Stars: 3
- Watchers: 17
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![npm version](https://badge.fury.io/js/figaro-js.svg)](https://badge.fury.io/js/figaro-js)
[![Build Status](https://travis-ci.org/LaunchPadLab/figaro-js.svg?branch=master)](https://travis-ci.org/LaunchPadLab/figaro-js)# figaro-js
This package emulates the behavior of [figaro](https://github.com/laserlemon/figaro) for rails. It loads environment variables from an `application.yml` file into `process.env`.
## Quickstart
In `./config/application.yml`:
```yml
SOME_VAR: 'FOO'development:
IS_DEV: trueproduction:
IS_PROD: true
```In your start script:
```js
const Figaro = require('figaro-js')
Figaro.load()
console.log(process.env.SOME_VAR) // -> 'FOO'
```
Using ES6 syntax:
```jsimport * 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](docs.md).
## Migration Guides
- [v2.0.0](migration-guides/v2.0.0.md)
- [v3.0.0](migration-guides/v3.0.0.md)