Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get MD5 hash from dependencies and devDependencies from a package.json
const crypto = require('crypto');
const pjson = require('../package.json');
const depsStr = JSON.stringify(pjson.dependencies);
const devDepsStr = JSON.stringify(pjson.devDependencies);
const allDepsStr = depsStr + devDepsStr;
console.log(crypto.createHash('md5').update(allDepsStr).digest("hex"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.