load-source-map

Reads a source file and extracts a sourcemap for consumption (inline or external)

MIT 5 个版本
安装
npm install load-source-map
yarn add load-source-map
pnpm add load-source-map
bun add load-source-map
README

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.

版本列表
3.0.1 2022-03-07
3.0.0 2022-03-07
2.0.0 2020-07-13
1.0.0 2017-03-30
0.0.1 2017-03-29