browserify-configify
v0.0.3
Published
Browserify transform for applying parameters in JSON configurations
Downloads
4
Readme
Configify substitutes the variables within JSON configurations with the values found from environment (process.env) or against a specified dictionary.
Example
var configify = require('browserify-configify');
Members
##configify.configify(file, cb) The default configify transformation, passed to Browserify.
Params
- file
String
- The file to transform - cb
function
- The callback to execute after the transform
Returns: - The browserify transform
Example
var configify = require('browserify-configify');
var b = browserify('app.js'));
b.transform(configify);
b.bundle(callback);
##configify.configure(opts) Pass a configuration to configify. Returns a new instance of configify, leaving the existing instance intact.
Currently the only option to configure is the dictionary to use for value substitutions that overrides environment variables.
Params
- opts
Object
- The configuration object to pass.
Returns: function
- A new instance of configify, with the given options
Example
var options = {
dict: { HOME: '/home/configify' }
};
var configured = configify.configure(options);
b.transform(configured);