Syllabus/themes/piratecare/node_modules/caller-callsite
Marcell Mars c832f9bfdb hugo stuff... 2020-03-05 05:10:52 +01:00
..
index.js hugo stuff... 2020-03-05 05:10:52 +01:00
license hugo stuff... 2020-03-05 05:10:52 +01:00
package.json hugo stuff... 2020-03-05 05:10:52 +01:00
readme.md hugo stuff... 2020-03-05 05:10:52 +01: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