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