From 22d4fef247892ae7cba832a6f042d15bba23e27a 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 3a209d98e6e1dd..f01417cda4a531 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1373,6 +1373,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