#byte-offset #scope #javascript #source #position #extracting #name

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

#1757 in Web programming

Download history 136/week @ 2024-03-31 93/week @ 2024-04-07 81/week @ 2024-04-14 48/week @ 2024-04-21 117/week @ 2024-04-28 112/week @ 2024-05-05 127/week @ 2024-05-12 152/week @ 2024-05-19 69/week @ 2024-05-26 370/week @ 2024-06-02 88/week @ 2024-06-09 97/week @ 2024-06-16 28/week @ 2024-06-23 48/week @ 2024-06-30 48/week @ 2024-07-07 80/week @ 2024-07-14

220 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

~15MB
~358K SLoC