0.9.4 • Published 10 years ago

json.mustache.js v0.9.4

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

json.mustache.js

Circle CI
npm version

##JSON configuration files with interpolated values

#Getting started

###Install it

$ npm install json.mustache.js

###Require it

var template = require('json.mustache.js');

###Add your configuration file (i.e. config/sample.json)

{
  "test": {
    "url": "mongodb://localhost:27017/{{id}}",
    "id": "test-db-name"
  },
  "development": {
    "url": "mongodb://localhost:27017/{{id}}",
    "id": "hookly-development"
  },
  "production": {
    "url": "mongodb://{{id}}:{{secret}}@sub.mongonodes.com:{{port}}/{{db}}",
    "id": "your-username",
    "secret": "your-password",
    "port": 27074
    "db": "your-db"
  }
}

###Use it
```javascript
process.env.NODE_ENV = 'production';
var config = template('config-file.json');
config.url
//=> "mongodb://your-username:your-password@sub.mongonodes.com:27074/your-db"
0.9.4

10 years ago

0.9.3

10 years ago

0.9.2

10 years ago

0.9.1

10 years ago

0.9.0

10 years ago