From 0bbce034f999bd887f3bb044800bf14204fd127e 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: