An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        

settings.json
=============

Super simple, environment aware, JSON settings reader for NodeJS.

[![Build Status](https://travis-ci.org/joona/settings.json.svg?branch=master)](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).