1 | [![Build Status](https://travis-ci.org/falsecz/cson-config.svg?branch=master)](https://travis-ci.org/falsecz/cson-config)
|
2 | [![Dependency Status](https://david-dm.org/falsecz/cson-config.svg)](https://david-dm.org/falsecz/cson-config)
|
3 | [![npm version](https://badge.fury.io/js/cson-config.svg)](http://badge.fury.io/js/cson-config)
|
4 |
|
5 | Installation
|
6 | -----
|
7 | `npm install cson-config`
|
8 |
|
9 | Usage
|
10 | -----
|
11 |
|
12 | `require('cson-config').load()`
|
13 | or
|
14 | `require('cson-config').load('/path/to/config.cson')`
|
15 |
|
16 |
|
17 | all variables are exported to process.config
|
18 |
|
19 | if `.env` is present content will be auto loaded to proces.env before loading config
|
20 | `
|
21 | NAME=server1
|
22 | PORT=5566
|
23 | `
|
24 |
|
25 |
|
26 |
|
27 | see test/
|
28 |
|
29 | Draft
|
30 | -----
|
31 | csonConfig = require 'cson-config'
|
32 | mongoq = require 'mongoq'
|
33 |
|
34 | csonConfig.use /^mongodb:/, (url) ->
|
35 | return mongoq url
|
36 | csonConfig.load()
|
37 |
|
38 | All values in configuration matching `/^mongodb:/` will be replaced by instance of mongoq
|