1const psList = require('ps-list');
2(async () => {
3 a = await psList(); // List all processes alive
4 var b = a.filter(o => {
5 if(o.pid === process.pid) { // process the process you want to check
6 console.log(o); // Log the process if it is alive
7 }
8 })
9})();