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

What does the __dirname variable hold in CommonJS?

  1. A The current working directory of the process
  2. B The absolute path of the directory containing the current module
  3. C The name of the current file
  4. D The path to node_modules
Answer

The absolute path of the directory containing the current module

__dirname is relative to the file itself, unlike process.cwd(), which depends on where the process was launched.

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