63 releases (37 stable)

9.1.2 Nov 26, 2024
9.0.0 Aug 2, 2024
8.0.1 Apr 2, 2024
8.0.0 Mar 22, 2024
0.3.2 Jul 15, 2016

#27 in Web programming

Download history 218841/week @ 2024-10-28 215016/week @ 2024-11-04 235578/week @ 2024-11-11 213806/week @ 2024-11-18 137689/week @ 2024-11-25 157435/week @ 2024-12-02 252005/week @ 2024-12-09 193460/week @ 2024-12-16 62003/week @ 2024-12-23 109178/week @ 2024-12-30 254511/week @ 2025-01-06 274100/week @ 2025-01-13 201796/week @ 2025-01-20 179435/week @ 2025-01-27 191796/week @ 2025-02-03 207888/week @ 2025-02-10

794,193 downloads per month
Used in 358 crates (29 directly)

BSD-3-Clause

155KB
3.5K SLoC

sourcemap

This library implements basic processing of JavaScript sourcemaps.

Installation

The crate is called sourcemap and you can depend on it via cargo:

[dependencies]
sourcemap = "*"

If you want to use the git version:

[dependencies.sourcemap]
git = "https://github.com/getsentry/rust-sourcemap.git"

Basic Operation

This crate can load JavaScript sourcemaps from JSON files. It uses serde for parsing of the JSON data. Due to the nature of sourcemaps the entirety of the file must be loaded into memory which can be quite memory intensive.

Usage:

use sourcemap::SourceMap;
let input: &[_] = b"{
    \"version\":3,
    \"sources\":[\"coolstuff.js\"],
    \"names\":[\"x\",\"alert\"],
    \"mappings\":\"AAAA,GAAIA,GAAI,EACR,IAAIA,GAAK,EAAG,CACVC,MAAM\"
}";
let sm = SourceMap::from_reader(input).unwrap();
let token = sm.lookup_token(0, 0).unwrap(); // line-number and column
println!("token: {}", token);

Features

Functionality of the crate can be turned on and off by feature flags. This is the current list of feature flags:

  • ram_bundle: turns on RAM bundle support

License: BSD-3-Clause

Dependencies

~4–5.5MB
~100K SLoC

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy