How to check if an arbitrary PID is running using Node.js?

后端 未结 3 1202
没有蜡笔的小新
没有蜡笔的小新 2021-01-07 18:30

Is there some way to check if an arbitrary PID is running or alive on the system, using Node.js? Assume that the Node.js script has the appropriate permissions to read

3条回答
  •  佛祖请我去吃肉
    2021-01-07 19:13

    I needed to check for running pid's in a project as well. I took this answer of using kill -0 and wrapped it up in a module called is-running https://npmjs.org/package/is-running

    npm install is-running

提交回复
热议问题