The process.ppid property returns the PID of the parent of the current process.
process.ppid
import { ppid } from 'node:process';console.log(`The parent process is pid ${ppid}`);
v9.2.0, v8.10.0, v6.13.0