What is the difference between fork() and spawn() methods in Node.js?

 

fork()

spawn()


fork() is a particular case of spawn() that generates a new instance of a V8 engine.

Spawn() launches a new process with the available set of commands.

Multiple workers run on a single node code base for multiple tasks.

This method doesn’t generate a new V8 instance and only a single copy of the node module is active on the processor.

Comments

Popular posts from this blog

Which node logger did you use in your project?

What is promise, promise.all and promise.race? How do you chain promises?