I wonder how-to get an absolute path of a caller of a function?
Let say that:
in file a.js I call b(); b() is a functi
a.js
b()
You can use require.resolve(module) to determine the full path of a module:
require.resolve(module)
var path = require.resolve("a"); //or var path = require.resolve("./a.js");