Dismiss
  • Toggle Theme
  • View as Mobile

Get Current File Path in Node.js

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