@jridgewell/sourcemap-codec
Encode/decode the mappings property of a sourcemap.
Why?
Sourcemaps are difficult to generate and manipulate, because the mappings property – the part that actually links the generated code back to the original source – is encoded using an obscure method called Variable-length quantity. On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap.
This package makes the process slightly easier.
Installation
1 | npm install @jridgewell/sourcemap-codec |
Usage
1 | import { encode, decode } from '@jridgewell/sourcemap-codec'; |
Benchmarks
1 | node v20.10.0 |
License
MIT