What does the __dirname variable hold in CommonJS?
- A The current working directory of the process
- B The absolute path of the directory containing the current module
- C The name of the current file
- 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.





