0.1.0 • Published 9 years ago

subconfig v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

subconfig

Browserify transform to substitute config variables using underscore templates.

Installation

$ npm install subconfig

Note that you must also install config package:

$ npm install config
$ mkdir config
$ $EDITOR config/default.js

Usage

To be able to write in your client-side code, say, var socket = Primus('<%= ServerAddress %>'), do

$ browserify -t subconfig app.js > bundle.js

To use custom prefix (<%= conf.ServerAddress %>):

$ browserify -t [ subconfig -p conf ] app.js > bundle.js

or

$ browserify -t [ subconfig --prefix conf ] app.js > bundle.js

Export NODE_ENV=production environment variable to switch to production config.

License

MIT