browserify-node-config

1.1.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i browserify-node-config

Weekly Downloads

0

Version

1.1.0

License

ISC

Last publish

Collaborators

  • mattmahn