fingerprinter

Generic assests fingerprint generator.

fingerprinter

Generic assests fingerprint generator. Generates md5 hash for a set of files or strings that you can append to URL to flush browser cache.

npm install --save fingerprinter
var Fingerprinter = require('fingerprinter');
var fp = new Fingerprinter();
fp.addFiles(['build/scripts.js', 'build/styles.css']);
fp.get(function(err, fingerprint) {
    if (!err) {
        console.log(fingerprint);
    }
});

Add string.

fp.add('body { color:red; }');

Add file(s).

fp.addFile('build/scripts.js');
fp.addFiles(['build/scripts.js', 'build/styles.css']);

Get hash.

fp.get(function(err, fingerprint) {
    // fingerprint = '73287dcc3d1ba241d7556412b7201af6'
});

Append hash to URL.

fp.makeUrl('build/scripts.js', function(err, uri) {
    // uri = 'build/scripts.js?73287dcc3d1ba241d7556412b7201af6'
});

The changelog can be found in the Changelog.md file.


The MIT License, see the included License.md file.