#source-map #scope #name #byte-offset #extracting #line-column #lookup #original #js #minified

js-source-scopes

Utilities for extracting and dealing with scope information in JS code

10 releases (5 breaking)

0.6.0 Mar 24, 2025
0.5.0 Jun 3, 2024
0.4.0 Sep 25, 2023
0.3.2 Jun 23, 2023
0.1.0 Sep 22, 2022

#731 in Algorithms

Download history 1029/week @ 2025-03-22 1267/week @ 2025-03-29 1274/week @ 2025-04-05 675/week @ 2025-04-12 991/week @ 2025-04-19 1088/week @ 2025-04-26 1083/week @ 2025-05-03 1172/week @ 2025-05-10 839/week @ 2025-05-17 776/week @ 2025-05-24 1061/week @ 2025-05-31 1245/week @ 2025-06-07 1155/week @ 2025-06-14 1026/week @ 2025-06-21 1031/week @ 2025-06-28 868/week @ 2025-07-05

4,361 downloads per month
Used in 2 crates (via symbolic-sourcemapcache)

Apache-2.0

235KB
903 lines

JS Source Scopes

Build Status codecov

This crate provides functionality for extracting and processing scope information from JavaScript source files, and resolving that scope via SourceMaps.

Features

  • Extracting scopes from source text using extract_scope_names
  • Fast lookup of scopes by byte offset using ScopeIndex
  • Fast conversion between line/column source positions and byte offsets using SourceContext
  • Resolution of minified scope names to their original names using NameResolver

License

JS Source Scopes is licensed under the Apache-2.0 license.

Dependencies

~15–24MB
~393K SLoC