1.1.0 • Published 9 years ago
browserify-node-config v1.1.0
browserify-node-config
Browserify transform for node-config library.
Install
npm install browserify-node-configExample
Grunt
var configify = require('browserify-node-config');
// ...
{
// ...
browserify: {
options: {
transform: [configify]
}
}
// ...
}package.json
{
"name": "mymodule",
"browserify": {
"transform": "config-browserify"
}
}Usage
ClientSide.js (which will be bundled by browserify)
var config = require('config');
global.window && console.log(config.get('Client.testProperty')); // prints `hello!`config/default.json
{
"ip": "0.0.0.0",
"port": 80,
"Client": {
"testProperty": "hi"
}
}Important
- For support for server-side rendering frameworks, there is no support for
watchifyat the moment. The entire app must be restarted in order to get config properties which were modified since the server started.