biobulkbende.org/node_modules/caller-callsite
Tancre 0efda7fffe structure, layout and automation 2020-09-16 14:23:28 +02:00
..
index.js structure, layout and automation 2020-09-16 14:23:28 +02:00
license structure, layout and automation 2020-09-16 14:23:28 +02:00
package.json structure, layout and automation 2020-09-16 14:23:28 +02:00
readme.md structure, layout and automation 2020-09-16 14:23:28 +02:00

readme.md

caller-callsite Build Status

Get the callsite of the caller function

Install

$ npm install --save caller-callsite

Usage

// foo.js
const callerCallsite = require('caller-callsite');

module.exports = () => {
	console.log(callerCallsite().getFileName());
	//=> '/Users/sindresorhus/dev/unicorn/bar.js'
}
// bar.js
const foo = require('./foo');
foo();

API

callerCallsite()

Returns a callsite object.

License

MIT © Sindre Sorhus