Bird
0
0

Which module must be imported to use the fork method in Node.js?

easy📝 Conceptual Q2 of 15
Node.js - Child Processes
Which module must be imported to use the fork method in Node.js?
Aos
Bcluster
Cprocess
Dchild_process
Step-by-Step Solution
Solution:
  1. Step 1: Identify the module providing fork

    The fork method is part of the child_process module in Node.js.

  2. Step 2: Verify other modules

    The cluster module is related but does not provide fork directly; process and os do not provide fork.

  3. Final Answer:

    child_process -> Option D
  4. Quick Check:

    fork module = child_process [OK]

Quick Trick: fork is from child_process module, not cluster or os [OK]
Common Mistakes:
  • Importing cluster instead of child_process
  • Using process or os modules incorrectly
  • Not importing any module

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes