subconfig

0.1.0 • Public • Published

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

Package Sidebar

Install

npm i subconfig

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • svbatalov