From 7db2e889ac70f80d8dc9edb99ec9cca86fea4e66 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 820c6992ae8e4f..31566d02490fb4 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: