Raxit Sheth Raxit Sheth - 5 months ago 11
Node.js Question

Node.js - getting current filename

How to get current file name, function name and line number?

I want to use it for logging/debugging purpose, equivalent to

__FILE__
,
__LINE__
in c

Answer
console.log(__dirname)
console.log(arguments.callee.toString())