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 <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
codedokode
2023-04-01 15:37:16 +03:00
committed by Rich Trott
parent e7bab6c500
commit dfbad862e0

View File

@@ -76,6 +76,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: