@visulima/source-map
v1.0.10
Published
Provides functionality related to source maps.
Downloads
271
Readme
Install
npm install @visulima/source-map
yarn add @visulima/source-map
pnpm add @visulima/source-map
Usage
import { loadSourceMap, originalPositionFor, sourceContentFor } from "@visulima/source-map";
const sourceMap = loadSourceMap("your_path/src/index.js"); // returns a TraceMap
const traced = originalPositionFor(sourceMap, { column: 13, line: 30 });
console.log(traced);
// {
// column: 9,
// line: 15,
// name: "setState",
// source: "your_path/src/index.js"
// }
console.log(sourceContentFor(sourceMap, traced.source)); // 'content for your_path/src/index.js'
For more information about the TraceMap see @jridgewell/trace-mapping
Related
Supported Node.js Versions
Libraries in this ecosystem make the best effort to track Node.js’ release schedule. Here’s a post on why we think this is important.
Contributing
If you would like to help take a look at the list of issues and check our Contributing guidelines.
Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Credits
License
The visulima source-map is open-sourced software licensed under the MIT