okie icon indicating copy to clipboard operation
okie copied to clipboard

feat: use `os.availableParallelism` when available

Open sapphi-red opened this issue 1 year ago • 0 comments

Now Node.js recommends using os.availableParallelism instead of os.cpus().length for this purpose. https://nodejs.org/api/os.html#oscpus:~:text=os.cpus().length%20should%20not%20be%20used%20to%20calculate%20the%20amount%20of%20parallelism%20available%20to%20an%20application.%20Use%20os.availableParallelism()%20for%20this%20purpose.

This PR makes the default value to use that when it's available. (Node.js 18.14.0+, 19.4.0+) https://nodejs.org/api/os.html#osavailableparallelism

I also updated TypeScript as the type check failed on my machine.

I tested this change by running yarn test on Node.js 18.17.1 (Windows) and on Node.js 18.12.1 (WSL).

sapphi-red avatar Aug 10 '23 11:08 sapphi-red