JSPM

discover-source-path

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q48990F
  • License MIT

Find the source file path of the current function being executed

Package Exports

  • discover-source-path

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (discover-source-path) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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

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);