tree: 0cd203f750e04e2239332ae9f44a4895592e676d [path history] [tgz]
  1. index.js
  2. license
  3. package.json
  4. readme.md
node_modules/caller-path/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