npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

trackingdog

v2.1.0

Published

cli for finding the original source location of a line+column in a generated file, utilizing the source map

Downloads

22

Readme

trackingdog

Find the source location of a line/column in a generated file. Supports JavaScript and CSS, local files and http urls.

Installation:

npm install -g trackingdog

Usage example:

$ trackingdog http://charcod.es/static/bundle-44.0449b572b5.js:4:22208
http://charcod.es/js/app.js:95:0

Note that it is also possible to pipe a full stack trace over stdin:

$ pbpaste | trackingdog # paste from clipboard (macos only)
$ trackingdog < myStacktraceFile.txt # pipe in a file

You can map local folders in as workspaces (à la Chrome Dev Tools) and have the remote files mapped to paths local to your filesystem:

$ trackingdog --workspace http://charcod.es/js=./src http://charcod.es/static/bundle-44.0449b572b5.js:4:22208
./src/app.js:95:0

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:16
			jQuery.ready();
		}
	},
	// Clean-up method for dom ready events
	detach = 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:

$ trackingdog path/to/jquery-1.10.1.min.js:4:745
testdata/existingJavaScriptSourceMap/jquery-1.10.1.js:109:16

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:

const TrackingDog = require('trackingdog');

const dog = new TrackingDog();

const { url, line, column } = await dog.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)

Releases

Changelog