process.ppid


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

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

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

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