https://github.com/seebigs/discover-source-path
Use tricks to find the source file path of the current function being executed
https://github.com/seebigs/discover-source-path
Last synced: 6 months ago
JSON representation
Use tricks to find the source file path of the current function being executed
- Host: GitHub
- URL: https://github.com/seebigs/discover-source-path
- Owner: seebigs
- Created: 2017-07-16T21:40:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-05T22:22:31.000Z (over 8 years ago)
- Last Synced: 2025-02-16T14:12:39.833Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# discover-source-path
**Use tricks to find the source file path of the current function being executed**
## Install
```
$ npm install discover-source-path
```
## Use
```js
var discoverRelativePath = require('discover-source-path');
var myFilePath = discoverRelativePath();
```
### stackDrop
If you need to trace back a different number of levels than the default, you can pass the number of lines to drop as a parameter (default is 2 lines dropped from the stack)
```js
discoverRelativePath(3);
```