Bird
0
0

Which Node.js module must you import to use the exec function?

easy📝 Conceptual Q2 of 15
Node.js - Child Processes
Which Node.js module must you import to use the exec function?
Afs
Bchild_process
Chttp
Dos
Step-by-Step Solution
Solution:
  1. Step 1: Identify module for exec

    The exec function is part of the child_process module in Node.js.
  2. Step 2: Eliminate other modules

    fs is for file system, http for servers, os for OS info, none provide exec.
  3. Final Answer:

    child_process -> Option B
  4. Quick Check:

    exec module = child_process [OK]
Quick Trick: exec is in child_process module, not fs or http [OK]
Common Mistakes:
  • Importing fs instead of child_process
  • Trying to use exec without importing child_process
  • Confusing exec with http module functions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes