Raxit Sheth Raxit Sheth - 1 year ago 101
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 Source
console.log(__dirname)
console.log(arguments.callee.toString())