How to get filename of script being executed in NodeJS?

node.js

Solution

You can use variable `__filename`

http://nodejs.org/docs/latest/api/globals.html#globals_filename

Problem

How to get filename of script being executed in NodeJS application?

Original source

Related problems