Open In App

Node.js process.ppid Property

Last Updated : 12 Oct, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

The process.ppid property is an inbuilt application programming interface of the process module which is used to get the PID of the current parent process.

Syntax:

process.ppid

Return Value: This property returns an integer value specifying the PID of the current parent process.

Below examples illustrate the use of process.ppid property in Node.js:

Example:




// Node.js program to demonstrate the
// process.ppid Property
   
// Include process module
const process = require('process');
  
// Printing process.pid value
console.log("process id is " + process.pid);
  
// Printing parent process.ppid
console.log("parent process id is " + process.ppid);


Output:

process id is 12024
parent process id is 12168

Note: The above program will compile and run by using the node filename.js command.

Reference: https://nodejs.org/api/process.html#process_process_ppid


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads