The process.pid property returns the PID of the process.
process.pid
import { pid } from 'node:process';console.log(`This process is pid ${pid}`);
v0.1.15