Node.js - Child Processes
Which of the following is the correct way to import and use
fork from the child_process module in Node.js?fork from the child_process module in Node.js?fork is a named export from child_process, so we use destructuring: const { fork } = require('child_process');fork() immediately, which is incorrect. import fork from 'child_process'; uses ES module syntax without proper setup. const fork = require('child_process').fork; assigns the function but misses destructuring. const { fork } = require('child_process'); is correct.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions