product/node_modules/caller-path
Ruikang Zhang e96405c650 Merge remote-tracking branch 'product/product' into product 2024-04-14 10:25:28 +08:00
..
index.js Merge remote-tracking branch 'product/product' into product 2024-04-14 10:25:28 +08:00
readme.md Merge remote-tracking branch 'product/product' into product 2024-04-14 10:25:28 +08:00

readme.md

caller-path Build Status

Get the path of the caller function

Install

$ npm install --save caller-path

Usage

// foo.js
const callerPath = require('caller-path');

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

License

MIT © Sindre Sorhus