包详细信息

source-mapper

mantoni13kMIT2.1.0

Replace strack traces with original sources using source maps

stack, trace, source-maps

自述文件

Source Mapper

Build Status SemVer License

Replace stack traces with original sources using source-map. For node and the browser.

Install

npm install source-mapper

Usage

var sourceMapper = require('source-mapper');

var extracted = sourceMapper.extract(js);
var throughStream = sourceMapper.stream(extracted.map);

API

  • extract(string) extracts an inline source map from the given string. The returned object has the js without source maps and a map with source maps.
  • consumer(map) returns a source map consumer for the given map.
  • line(consumer, line[, offset]) maps the given line to the original source using a consumer. If offset is given, it is substracted from the line number.
  • stream(consumer[, offset]) returns a through2 stream that replaces URLs in stack traces with the original source location using a consumer. If offset is given, it is substracted from the line number.
  • stream(map[, offset]) returns a through2 stream that replaces URLs in stack traces with the original source location using a source map. If offset is given, it is substracted from the line number.

Development

Clone the repository and then run:

npm install
npm test

Compatibility

  • Node 0.10 or later
  • Browserify 5.9 or later

License

MIT

更新日志

Changes

2.1.0

2.0.0

  • Streams 3

1.0.6

  • Don't print a potentially wrong column number

1.0.5

  • Add "files" to package.json

1.0.4

  • Bump through2 to ^1.1 to align with browserify

1.0.3

  • Handle more stack trace formats and unify indentation

1.0.2

  • Bump dependencies
  • Remove unused require
  • Run tests on node 0.10 and 0.12

1.0.1

  • Fix parsing traces with columns
  • Improve matcher regexp and trace formatting

1.0.0

  • Use Browserify 5.9 for testing
  • Map <anonymous> lines
  • Use through2
  • Use convert-source-map ^0.4

0.3.0

  • Add optional offset parameter

0.2.1

  • Map IE 10 stack traces

0.2.0

  • Reduce false matches
  • Add support to map single lines

0.1.0

  • Initial release