// the find
evanw/node-source-map-support
Adds source map support to node.js (for stack traces)
source-map-support monkey-patches Node's V8 stack trace API so that TypeScript, CoffeeScript, and any other compile-to-JS language shows original file paths and line numbers in stack traces instead of the compiled output. It's been the standard solution for this problem for years. The target audience is anyone running transpiled JavaScript in Node who wants readable errors.
Node 12.12.0 shipped native --enable-source-maps, and the README says so upfront rather than hiding it — that's honest documentation that most library authors skip. The retrieveSourceMap callback is genuinely useful for environments like Meteor where maps live in memory rather than on disk. The -r source-map-support/register pattern means zero code changes to your source files, which matters when you're patching in a build step. Works in Chrome's V8 too, not just Node, so the same trick applies to Electron and browser error reporting.
The last meaningful commit was mid-2024 and the project has been in maintenance mode for years — the CI badge still points at Travis CI, which has been effectively dead for open-source since 2021, so you have no idea if the tests actually pass. The hookRequire option, which is the only way to handle inline source maps, is explicitly described as not safe for production, which is a real gap if your build toolchain generates inline maps. It's also now unnecessary for the vast majority of projects since Node 12.12.0+, meaning anyone picking this up in 2025 should probably just use the --enable-source-maps flag instead and skip the dependency.