process.ppid


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

console.log(`父进程的 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}`);