![]() |
VOOZH | about |
The __dirname string gives the directory path of the current module, this is also similar to that of path.dirname() of the filename.
Return Value : It returns the directory path of the current module.
Example 1: Let's create a file main.js
Output: Now run node main.js.
👁 ImageExample 2: Replicating __dirname with path.dirname().
Output: Now run node main.js.
👁 Image