From 45c37c2ec76ab3db74f437997558c8f31dc0255e Mon Sep 17 00:00:00 2001 From: codedokode Date: Sat, 1 Apr 2023 15:37:16 +0300 Subject: [PATCH] doc: add a note about os.cpus() returning an empty list It is not obvious that in some cases cpus() returns an empty list and this has caused a bug before: https://github.com/isaacs/promise-call-limit/pull/11 PR-URL: https://github.com/nodejs/node/pull/47363 Reviewed-By: Ben Noordhuis Reviewed-By: Rich Trott --- doc/api/os.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/os.md b/doc/api/os.md index 0006b347dc2658..7d55f97f2d8a26 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -74,6 +74,8 @@ added: v0.3.3 * Returns: {Object\[]} Returns an array of objects containing information about each logical CPU core. +The array will be empty if no CPU information is available, such as if the +`/proc` file system is unavailable. The properties included on each object include: