#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 65/week @ 2024-02-02 76/week @ 2024-02-09 88/week @ 2024-02-16 115/week @ 2024-02-23 76/week @ 2024-03-01 55/week @ 2024-03-08 62/week @ 2024-03-15 107/week @ 2024-03-22 122/week @ 2024-03-29 95/week @ 2024-04-05 93/week @ 2024-04-12 37/week @ 2024-04-19 106/week @ 2024-04-26 128/week @ 2024-05-03 70/week @ 2024-05-10 205/week @ 2024-05-17

518 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–14MB
~202K SLoC