Differentiate between spawn() and fork() methods in Node.js?

The child_process.spawn() method spawns the child process asynchronously, without blocking the Node.js event loop.

child_process.fork(): spawns a new Node.js process and invokes a specified module with an IPC communication channel established that allows sending messages between parent and child.

Comments

Popular posts from this blog

What is a Callback function in Node.js?

What is an Event loop in Node.js and how does it work?