• Toggle Theme
  • Search Site
  • View as Mobile

The __filename constant will print out the current file path in NodeJS

console.log(__filename)
// => /location/on/computer/or/server/filename.js

More info on node globals can be found here: NodeĀ Globals