NodeJS is a powerful tool for backend developers, but you must be aware of multi-core processing in order to maximize the potential of your CPU. This NodeJS multi-core feature is mostly used for webservers and NodeJS has already out of the box the cluster
module thereto. Although NodeJS has also out of the box the module threads
used for CPU intensive jobs, it's not so easy to deal with.
Let's create a project that will test a single-thread and a multi-thread application with the task of running N
iterations, each iteration doing heavy data processing and writing some random data to a file, each iteration having a different file.
Create the project:
mkdir test-threads && cd test-threads
npm init -y