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

js-source-scopes

Utilities for extracting and dealing with scope information in JS code

8 releases

0.4.0 Sep 25, 2023
0.3.2 Jun 23, 2023
0.3.1 Nov 28, 2022
0.2.2 Nov 21, 2022
0.1.0 Sep 22, 2022

#4 in #byte-offset

Download history 94/week @ 2024-01-08 35/week @ 2024-01-15 46/week @ 2024-01-22 72/week @ 2024-01-29 60/week @ 2024-02-05 103/week @ 2024-02-12 67/week @ 2024-02-19 123/week @ 2024-02-26 72/week @ 2024-03-04 63/week @ 2024-03-11 56/week @ 2024-03-18 101/week @ 2024-03-25 134/week @ 2024-04-01 93/week @ 2024-04-08 82/week @ 2024-04-15

412 downloads per month
Used in 2 crates (via symbolic-sourcemapcache)

Apache-2.0

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

~7–15MB
~202K SLoC