在我正在处理的 node.js 脚本中,我想将所有 node.js 模块(使用 npm 安装)打印到命令行。我该怎么做?
console.log(__filename);
//now I want to print all installed modules to the command line. How can I do this?
最佳答案
如果您只对全局安装的软件包感兴趣,而没有完整的树,那么:
npm -g ls --depth=0
或本地(省略-g):
npm ls --depth=0
关于javascript - 打印所有已安装的 node.js 模块的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13981938/