Skip to content
master
Switch branches/tags
Code

Latest commit

Update hash function to not provide an error callback and throw excep…
311c4ff

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

browserify-hash

Detect changes to a Browserify bundle's source files

Browserify-hash detects changes in a Browserify bundle's source files by generating and comparing a hash for the entry module and its dependency tree.

API

Begin by requiring browserify-hash:

var bsfyHash = require( 'browserify-hash' );

bsfyHash.changed( entryModule, cb, opts )

/**
 * Returns if a bundle's source files have changed given its entry module. Hits
 * return false, misses return true. First-runs are always misses.
 *
 * @param {String}   entryFile - Path to the Browserify bundle's entry-point
 *                               source file
 * @param {Function} cb        - Callback to call with encountered errors, and
 *                               the resulting hash
 *
 * @param {Object} opts                    - Options object
 * @param {Object} [opts.skipMissing=true] - Consider mising files unchanged.
 * @param {String} [hashFile='.bsfy-hash'] - JSON file to store the hashes to
 *                                           detect changes between runs
 * @param {Array}  [opts.exclude=[]]       - Dependencies to exclude from
 *                                           consideration
 * @param {Array}  [opts.include=[]]       - Additional files to include in the
 *                                           dep tree
 */

bsfyHash.hash( entryModule, cb, opts )

/**
 * Generate a hash representing a Browserify bundle's source files.
 *
 * @param {String}   entryFile - Path to the Browserify bundle's entry-point
 *                               source file
 * @param {Function} cb        - Callback to call with encountered errors, the
 *                               resulting hash, and the raw dependency path ->
 *                               source hash object
 *
 * @param {Object} opts                     - Options object
 * @param {Object} [opts.bsfy=browserify()] - Provide your own configured
 *                                        Browserify instance.
 * @param {Array}  [opts.exclude=[]]      - Dependencies to exclude from
 *                                        consideration, e.g., `lodash`, which
 *                                        can degrade performance
 * @param {Array}  [opts.include=[]]      - Additional files to include in the
 *                                        dep tree
 */

Resources

License

MIT

About

Detect changes to a Browserify bundle's source files

Resources

Packages

No packages published