You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the referenced source file can be retrieved, you'll get a bit of context:
$trackingdog https://code.jquery.com/jquery-1.10.1.min.js:4:745
https://code.jquery.com/jquery-1.10.1.js:109:16jQuery.ready();}},// Clean-up method for dom ready eventsdetach=function(){if(document.addEventListener){^
If the source asset is available as a local file, the output will be a
CWD-relative path with :<line>:<column> appended:
That means you can use it to build a command line to open an editor that
supports that syntax for jumping directly to a specific line/column:
atom `trackingdog path/to/jquery-1.10.1.min.js:4:745`
code -g `trackingdog path/to/jquery-1.10.1.min.js:4:745`
Programmatic usage
The main export of the package is a TrackingDog class that can be used
to track one or more source locations via the track method. The assets
loaded and parsed as part of this effort are cached in the instance, so
it's cheaper to track more source locations in the same files.
Example usage:
constTrackingDog=require('trackingdog');constdog=newTrackingDog();const{ url, line, column }=awaitdog.track({url: 'https://code.jquery.com/jquery-1.10.1.min.js',line: 4,column: 19,});console.log(`Yay, the location in the original source is ${url}:${line}:${column}`);
Future ideas
Recursively attempt to load the source file and see if it also has a source
map reference (in case someone used a "dist" file in a bundle without using
source-map-loader or equivalent)