0.0.12 • Published 10 years ago

understack v0.0.12

Weekly downloads
15
License
MIT
Repository
github
Last release
10 years ago

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 compiling foo.js and bar.js
  • project/build/minified/source_map - source-map for min.js
  • project/script.js - here you require understack.js
var understack = require('understack');
understack.addSourceMap(__dirname + 'build/minified/source_map', function(err) {
  if (err) console.log(err);
});
// . . .
// get error with stacktrace from minified code
var stack = err.stack;
understack.read(stack, function(originStack) {
  // do something with original stacktrace
});

TODO

  • write more examples
  • improve error handling
  • write some tests
0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago