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)

Readme

Keywords

none

Package Sidebar

Install

npm i source-map-to-code

Weekly Downloads

2

Version

1.0.8

License

MIT

Unpacked Size

76.2 kB

Total Files

12

Last publish

Collaborators

  • 15000621931