From 41937bedf916a50ca025e0a0fe77433ddd7f5c8a Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 30 Oct 2017 16:14:15 -0400 Subject: [PATCH] src: add process.ppid Fixes: https://github.com/nodejs/node/issues/14957 PR-URL: https://github.com/nodejs/node/pull/16839 Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell --- doc/api/process.md | 13 +++++++++++++ src/node.cc | 9 +++++++++ test/parallel/test-process-ppid.js | 16 ++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 test/parallel/test-process-ppid.js diff --git a/doc/api/process.md b/doc/api/process.md index ef1a916a43653f..de3202c5d88a11 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1416,6 +1416,19 @@ system platform on which the Node.js process is running. For instance console.log(`This platform is ${process.platform}`); ``` +## process.ppid + + +* {integer} + +The `process.ppid` property returns the PID of the current parent process. + +```js +console.log(`The parent process is pid ${process.ppid}`); +``` + ## process.release