如何在启动时查看传递给 Node.js 的 pm2 命令行参数? [英] How to view pm2 command line arguments passed to Node.js at startup?
问题描述
作为服务器管理员,我想查看使用 pm2 启动 Node.js 服务的命令行参数.(Node.js 通过 process.argv
使用的那些)
As a server administrator, I would like to view the command line arguments that a Node.js service was started with using pm2. (The ones that Node.js uses via process.argv
)
命令 pm2 show my-service-name
提供有关该服务的信息,但不显示用于启动它的命令.
The command pm2 show my-service-name
gives information around that service but does not display the command that was used to start it.
例如pm2 start index.js -- myProcessArgument
谁能告诉我在哪里可以看到 myProcessArgument
,或者更好的是,上面的完整行?
Can anyone please tell me where I can see myProcessArgument
, or even better, the full line above?
推荐答案
您所要做的就是:
pm2 describe <id of application or name>
示例
pm2 describe 1 or pm2 describe app
对于 Json 输出
pm2 jlist
输出应该有 script args
标签,将描述所有命令行参数,你可以找到更多信息 这里
The output should have script args
tag that will describe all command line arguments,You can find more information here
这篇关于如何在启动时查看传递给 Node.js 的 pm2 命令行参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!