Skip to content

Instantly share code, notes, and snippets.

@ecasilla
Created December 22, 2014 13:57
Show Gist options
  • Select an option

  • Save ecasilla/fbd87cc9751735a49857 to your computer and use it in GitHub Desktop.

Select an option

Save ecasilla/fbd87cc9751735a49857 to your computer and use it in GitHub Desktop.
append md5 to path for browser caching
var calculateMD5String, filepath, md5;
md5 = require('MD5');
calculateMD5String = function(path) {
return '-' + md5(fs.readFileSync(path));
};
filepath = "app" + calculateMD5String("app.js") + ".js";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment