Node.js: boost perf with worker threads

Node.js is a powerful and efficient tool. However, because it is single threaded we might have issues when working with CPU-intensive operations. For example, when you try to upload large JSON or media files. This operation will most likely block the main thread and every other operation will have to wait until it’s completed. First off, what is a worker thread in Node.js? A worker thread is a sequence of instructions within…

Streaming a Video with Node.js

Streaming is the process of consuming data continuously in part without downloading the entire file at once to your device and then using it afterward. Think of YouTube, Netflix, and Amazon Prime, these platforms allow you to watch videos without first downloading the entire video to your device. Imagine having to download all the videos you see on social media before watching them. That will be so much work, a…

Process.nextTick, the event loop invader

process.nextTick() is that tough customer that gets in a bank queue and says to the banker, attend to me after the current customer you are attending to, regardless of whether it’s my turn or not.  Rude, right? While trying to understand the fundamentals of Javascript & NodeJS, the event loop is usually one of the crucial concepts you’ll come across. The event loop allows Node.js to perform non-blocking I/O operations…