load-source-map

3.0.1 • Public • Published

load-source-map

Version npmBuild Status

Given a source file location, will load any referenced (or inline) source map.
Result is a SourceMapConsumer.

Installation

$ npm install --save load-source-map

Usage

var loadSourceMap = require('load-source-map')

loadSourceMap(__filename, function (err, sourcemap) {
  if (err) {
    throw err
  }

  if (!sourcemap) {
    // No source map found
    return
  }

  console.log(sourcemap.originalPositionFor({
    line: 3,
    column: 10,
  }))

  // { source: 'some-file.js',
  //   line: 2,
  //   column: 2,
  //   name: null }
})

License

MIT-licensed. See LICENSE.

Readme

Keywords

Package Sidebar

Install

npm i load-source-map

Weekly Downloads

24,982

Version

3.0.1

License

MIT

Unpacked Size

5.42 kB

Total Files

4

Last publish

Collaborators

  • rexxars