Socket
Socket
Sign inDemoInstall

source-mapper

Package Overview
Dependencies
3
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

source-mapper

Replace URLs in track traces with original sources


Version published
Weekly downloads
1.8K
increased by158.57%
Maintainers
1
Install size
345 kB
Created
Weekly downloads
 

Changelog

Source

1.0.0

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

Readme

Source

Source Mapper

Build Status SemVer License

Replace URLs in stack traces with original sources based on 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 through 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 through 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

FAQs

Last updated on 05 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc