Here is just a script to collect dependencies in. / node_modules:
var fs = require("fs"); function main() { fs.readdir("./node_modules", function (err, dirs) { if (err) { console.log(err); return; } dirs.forEach(function(dir){ if (dir.indexOf(".") !== 0) { var packageJsonFile = "./node_modules/" + dir + "/package.json"; if (fs.existsSync(packageJsonFile)) { fs.readFile(packageJsonFile, function (err, data) { if (err) { console.log(err); } else { var json = JSON.parse(data); console.log('"'+json.name+'": "' + json.version + '",'); } }); } } }); }); }
For one project I'm working on, the result is as follows:
"progress": "0.1.0", "request": "2.11.4",
If you forget to remove the comma from the last entry, you can copy and paste the result.
Jesse lawson
source share