Skip to content

Commit 9efac64

Browse files
codedokodeRafaelGSS
authored andcommitted
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: isaacs/promise-call-limit#11 PR-URL: #47363 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent e868916 commit 9efac64

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/api/os.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ added: v0.3.3
7676
* Returns: {Object\[]}
7777

7878
Returns an array of objects containing information about each logical CPU core.
79+
The array will be empty if no CPU information is available, such as if the
80+
`/proc` file system is unavailable.
7981

8082
The properties included on each object include:
8183

0 commit comments

Comments
 (0)