source-map-to-code
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

source-map-to-code

Get the source code information from the compiled file and error information location through source map

install

yarn add source-map-to-code

example

const { printSourceCodeInfo, getSourceCodeInfo } = require('source-map-to-code')

printSourceCodeInfo({
    filePath: './build/static/js/main.4e7cf41f.js',
    position: {
        line: 3,
        column: 0
    }
})

// print

Source code file path:
  ./es6/test.js

Source code snippets:
  2  var isTest = true
  3  const version = window.version   <------ Error(3:0)
  4  console.log(version)

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.84latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.84
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.21
1.0.10
1.0.00
0.1.00

Package Sidebar

Install

npm i source-map-to-code

Weekly Downloads

5

Version

1.0.8

License

MIT

Unpacked Size

76.2 kB

Total Files

12

Last publish

Collaborators

  • 15000621931