Nodejs: get filename of caller function

前端 未结 7 1224
心在旅途
心在旅途 2020-11-30 03:41

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

7条回答
  •  庸人自扰
    2020-11-30 03:55

    The npm caller package has a function that returns the path and filename of the callers.

提交回复
热议问题