How to get current file name, function name and line number?
I want to use it for logging/debugging purpose, equivalent to __FILE__, __LINE__
within a module you can do any of the following to get the full path with filename
this.filename;
module.filename;
__filename;
If you just want the actual name with no path or extension you can do something like this.
module.filename.slice(__filename.lastIndexOf(path.sep)+1, module.filename.length -3);