https://github.com/joona/settings.json
Super simple, environment aware, JSON settings reader for NodeJS
https://github.com/joona/settings.json
Last synced: 2 months ago
JSON representation
Super simple, environment aware, JSON settings reader for NodeJS
- Host: GitHub
- URL: https://github.com/joona/settings.json
- Owner: joona
- License: mit
- Created: 2014-06-05T21:57:16.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-04T15:07:37.000Z (over 9 years ago)
- Last Synced: 2025-03-10T09:09:56.430Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
settings.json
=============Super simple, environment aware, JSON settings reader for NodeJS.
[](https://travis-ci.org/joona/settings.json)
## Installation
npm install settings.json
## Get started
```javascript
var settings = require('settings.json')(__dirname + '/config/settings.json', 'development');
```## Usage
require('settings.json')( [, [, ]])
One or many paths for settings file(s). Files are loaded in specified order
and overlapping settings from the previous file will be overridden with the ones
from latter one.
Environment to select from the settings, defaults to "production".Object with additional options. Supported options:
options.quiet:
Do not throw if file doesn't exist or it's content is invalid JSON. Defaults to false.### Examples
Check out [tests](https://github.com/joona/settings.json/blob/master/test/lib/settings_test.js).