From 2d4fca2c41fd20794e323d7d8edcb5a3f1b1d9ed 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 ef8b89abfb877b..67d311d9a07fa2 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1326,6 +1326,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