oxc/crates/oxc_module_lexer
Ali Rezvani fc3878350f
refactor(ast): add walk_mut functions (#2776)
* move `visit` and `visit_mut` modules to a super module called `visit`
* add `walk_mut` module containing walk functions
* update `enter_node` and `leave_node` events to not pass a reference in the `VisitMut` trait
* add `AstType`, a non-referencing version of `AstKind` to use with `VisitMut` trait
* update the `VisitMut` trait's usages.
2024-03-25 20:40:13 +03:30
..
examples
src refactor(ast): add walk_mut functions (#2776) 2024-03-25 20:40:13 +03:30
tests
Cargo.toml
README.md

Oxc Module Lexer

This is not a lexer. The name "lexer" is used for easier recognition.

es-module-lexer

Outputs the list of exports and locations of import specifiers, including dynamic import and import meta handling.

Does not have any limitations mentioned in es-module-lexer.

cjs-module-lexer

  • TODO

Benchmark

This is 2 times slower than es-module-lexer, but will be significantly faster when TypeScript is processed.

The difference is around 10ms vs 20ms on a large file (700k).