3fc35d71d233f9a92ed48f74719aa41ad1ea673213e3365288bb9fcbbccb187ecfa2811d970c532669346a64567bab74950a2d8de3b5776f43e06a5ac1d8d3 539 B

12345678910111213141516171819202122232425262728293031323334
  1. # caller-path [![Build Status](https://travis-ci.org/sindresorhus/caller-path.svg?branch=master)](https://travis-ci.org/sindresorhus/caller-path)
  2. > Get the path of the caller function
  3. ## Install
  4. ```
  5. $ npm install --save caller-path
  6. ```
  7. ## Usage
  8. ```js
  9. // foo.js
  10. const callerPath = require('caller-path');
  11. module.exports = () => {
  12. console.log(callerPath());
  13. //=> '/Users/sindresorhus/dev/unicorn/bar.js'
  14. }
  15. ```
  16. ```js
  17. // bar.js
  18. const foo = require('./foo');
  19. foo();
  20. ```
  21. ## License
  22. MIT © [Sindre Sorhus](https://sindresorhus.com)