1.0.0 • Published 8 years ago

discover-source-path v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

discover-source-path

Use tricks to find the source file path of the current function being executed

Install

$ npm install discover-source-path

Use

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)

discoverRelativePath(3);