-
-
Save liamkeily/9edcae680ea0a30cdec5d6c5d6fa8c21 to your computer and use it in GitHub Desktop.
Compare your installed node_modules with clean npm install
This file contains hidden or 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) { | |
| try { | |
| 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) | |
| } | |
| }catch(e){} | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment