Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

In CommonJS, what does module.exports do?

  1. A Imports another module
  2. B Defines what the module makes available to code that requires it
  3. C Declares dependencies
  4. D Exports environment variables
Answer

Defines what the module makes available to code that requires it

module.exports is the object returned by require(). Reassigning exports alone does not work, because it only rebinds the local variable.

All NodeJS MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as