Optimized ~Nodejs~ File System
When running an application in NodeJS, it’s single threaded, and will only utilise a single core.
When performing cpu-intensive or a great number of tasks, you may see this impacting performance, and see runtime/respond-time increase.
If your NodeJS Application has 100% cpu-usage and is taking a long time to complete or slow to respond, this can be improved by dividing the work to be done, and spreading it over multiple processes.
Traditional (Many tasks to a single node process)
Distributed (Many tasks to distributed to multiple worker processes)
ofs creates and manage multiples processes which communicate between themself. This approach helps a lot for a non-blocking nodejs architechure.
Even if you use FS native stream API or based on async ways to this job, will always run on the nodejs main thread (in idle status or not).
For install ofs, just run in your terminal:
npm i ofs -S
const read =const stream = // absolute pathstreamstreamstream
const write =const stream = // absolute pathstreamstreamstream