process.ppid


process.ppid 属性返回当前进程的父进程的 PID。

console.log(`The parent process is pid ${process.ppid}`);

The process.ppid property returns the PID of the parent of the current process.

console.log(`The parent process is pid ${process.ppid}`);