Created
December 17, 2018 13:07
-
-
Save guilhermejcgois/29245fe657891faa27f48b6be41c82cb to your computer and use it in GitHub Desktop.
Get MD5 hash from dependencies and devDependencies from a package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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