Get the callsite of the caller function
$ npm install --save caller-callsite
```js // foo.js const callerCallsite = require('caller-callsite');
module.exports = () => { console.log(callerCallsite().getFileName()); //=> '/Users/sindresorhus/dev/unicorn/bar.js' } ```
js
// bar.js
const foo = require('./foo');
foo();
Returns a callsite
object.
MIT © Sindre Sorhus