Created
October 17, 2014 21:14
-
-
Save gimenete/f4c761a13516b07bbd4a to your computer and use it in GitHub Desktop.
Compare your installed node_modules with clean npm install
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
// mv node_modules node_modules_old && npm install | |
var fs = require('fs') | |
var path = require('path') | |
var node_modules = path.join(__dirname, 'node_modules') | |
var node_modules_old = path.join(__dirname, 'node_modules_old') | |
fs.readdir(node_modules, function(err, files) { | |
files.forEach(function(dir) { | |
if (dir.charAt(0) === '.') return | |
var pckg = require(path.join(node_modules, dir, 'package.json')) | |
var pckg2 = require(path.join(node_modules_old, dir, 'package.json')) | |
if (pckg.version !== pckg2.version) { | |
console.log(dir, 'before', pckg2.version, 'after', pckg.version) | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment