Syllabus/themes/sandpoints/node_modules/caller-callsite
Marcell Mars fd78b9e4e3 initial sandpoints theme commit.. 2020-08-19 01:14:35 +02:00
..
index.js initial sandpoints theme commit.. 2020-08-19 01:14:35 +02:00
license initial sandpoints theme commit.. 2020-08-19 01:14:35 +02:00
package.json initial sandpoints theme commit.. 2020-08-19 01:14:35 +02:00
readme.md initial sandpoints theme commit.. 2020-08-19 01:14:35 +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