📌  相关文章
📜  js 检查进程是否存活 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:42.910000             🧑  作者: Mango

代码示例1
const psList = require('ps-list');
(async () => {
  a = await psList(); // List all processes alive
  var b = a.filter(o => {
    if(o.pid === process.pid) { // process the process you want to check
      console.log(o); // Log the process if it is alive
    }
  })
})();