From f932f4c5185a652052a108a2c7abc41caf23ca9a Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Thu, 2 Nov 2023 21:21:21 +0100 Subject: [PATCH] lib: add navigator.platform PR-URL: https://github.com/nodejs/node/pull/50385 Reviewed-By: Geoffrey Booth Reviewed-By: Yagiz Nizipli Reviewed-By: James M Snell --- doc/api/globals.md | 15 +++++++++ lib/internal/navigator.js | 57 +++++++++++++++++++++++++++++++ test/parallel/test-navigator.js | 59 +++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+) diff --git a/doc/api/globals.md b/doc/api/globals.md index ebaaf2a6e0012e..187455eee772ff 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -637,6 +637,21 @@ logical processors available to the current Node.js instance. console.log(`This process is running on ${navigator.hardwareConcurrency} logical processors`); ``` +### `navigator.platform` + + + +* {string} + +The `navigator.platform` read-only property returns a string identifying the +platform on which the Node.js instance is running. + +```js +console.log(`This process is running on ${navigator.platform}`); +``` + ### `navigator.userAgent`