1.0.5 • Published 9 years ago

config-browserify v1.0.5

Weekly downloads
165
License
ISC
Repository
-
Last release
9 years ago

Configify

Browserify transform for node-config library

Install

npm install config-browserify

Example

Setup (via Grunt OR package.json)

Gruntfile.js

var configify = require('config-browserify');
// ...
{
    // ...
	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

{
  "Client": {
  	"testProperty": "hello!"
  }
}

Important

  • For security purposes, only the Client level config properties can be accessible from client-side code (which is bundled by browserify)
  • 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.
1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago