browserify-configify

0.0.3 • Public • Published

#browserify-configify view on npm npm module downloads per month Build Status Dependency Status

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);

Readme

Keywords

Package Sidebar

Install

npm i browserify-configify

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • laurisvan