browserify-node-config
v1.1.0
Published
Browserify transform for node-config (aka. config) library
Downloads
10
Readme
browserify-node-config
Browserify transform for node-config library.
Install
npm install browserify-node-config
Example
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
watchify
at the moment. The entire app must be restarted in order to get config properties which were modified since the server started.