No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

hace 3 años
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)