understack
Translate stacktraces from minified JS to readable format.
This lib relies on source-map (by Mozilla) to find position of given line and column.
Install
npm install understack
Usage
Example 1: one source-map and same path for original js files
Suppose your project structure looks like this:
project/src/foo.js
project/src/bar.js
project/build/minified/min.js
- result of compilingfoo.js
andbar.js
project/build/minified/source_map
- source-map formin.js
project/script.js
- here you require understack.js
var understack = ;understack;// . . .// get error with stacktrace from minified codevar stack = errstack;understack;
TODO
- write more examples
- improve error handling
- write some tests