#byte-offset #source-map #javascript #scope #name #position #js

js-source-scopes

Utilities for extracting and dealing with scope information in JS code

9 unstable releases (4 breaking)

0.5.0 Jun 3, 2024
0.4.0 Sep 25, 2023
0.3.2 Jun 23, 2023
0.3.1 Nov 28, 2022
0.1.0 Sep 22, 2022

#8 in #byte-offset

Download history 413/week @ 2024-11-21 393/week @ 2024-11-28 479/week @ 2024-12-05 352/week @ 2024-12-12 211/week @ 2024-12-19 72/week @ 2024-12-26 219/week @ 2025-01-02 533/week @ 2025-01-09 603/week @ 2025-01-16 1040/week @ 2025-01-23 1146/week @ 2025-01-30 959/week @ 2025-02-06 898/week @ 2025-02-13 781/week @ 2025-02-20 1289/week @ 2025-02-27 1075/week @ 2025-03-06

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

Apache-2.0

230KB
901 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

~16–25MB
~401K SLoC