$ npm install load-source-map
Given a source file location, will load any referenced (or inline) source map.
Result is a SourceMapConsumer.
$ npm install --save load-source-map
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 }
})
MIT-licensed. See LICENSE.
© 2010 - cnpmjs.org x YWFE | Home | YWFE