Package Exports
- @visulima/source-map
- @visulima/source-map/package.json
Readme
visulima source-map
Provides functionality related to source maps.
[][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]
Daniel Bannert's open source work is supported by the community on GitHub Sponsors
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][license-url]
[typescript-url]: https://www.typescriptlang.org/ "TypeScript" "typescript" [license-image]: https://img.shields.io/npm/l/@visulima/source-map?color=blueviolet&style=for-the-badge [license-url]: LICENSE.md "license" [npm-image]: https://img.shields.io/npm/v/@visulima/source-map/latest.svg?style=for-the-badge&logo=npm [npm-url]: https://www.npmjs.com/package/@visulima/source-map/v/latest "npm"