1. Home
  2. Node
  3. Module filename

Filename argument belongs to module wrapper function and it stores the module name including the absolute path to the file.

#node#module
console.log("Filename: " + __filename);
copy
Full Node cheatsheet