In a node.js script that I\'m working on, I want to print all node.js modules (installed using npm) to the command line. How can I do this?
console.log(__fil
Why not grab them from dependencies in package.json?
dependencies
package.json
Of course, this will only give you the ones you actually saved, but you should be doing that anyway.
console.log(Object.keys(require('./package.json').dependencies));