oxc/napi/parser/Cargo.toml
Boshen 32303b20fb
New tool: oxc_module_lexer (#2650)
# Oxc Module Lexer

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

## [es-module-lexer](https://github.com/guybedford/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](https://github.com/guybedford/es-module-lexer?tab=readme-ov-file#limitations)
mentioned in `es-module-lexer`.

I'll also work on the following cases to make this feature complete.

- [ ] get imported variables
https://github.com/guybedford/es-module-lexer/issues/163
- [ ] track star exports as imports as well
https://github.com/guybedford/es-module-lexer/issues/76
- [ ] TypeScript specific syntax
- [ ] TypeScript `type` import / export keyword

## [cjs-module-lexer](https://github.com/nodejs/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).
2024-03-09 23:23:55 +08:00

43 lines
1.1 KiB
TOML

[package]
name = "oxc_parser_napi"
version = "0.0.0"
publish = false
authors.workspace = true
description.workspace = true
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
categories.workspace = true
[lints]
workspace = true
[lib]
crate-type = ["cdylib"]
test = false
doctest = false
[dependencies]
oxc_allocator = { workspace = true }
oxc_parser = { workspace = true }
oxc_ast = { workspace = true, features = ["serde"] }
oxc_span = { workspace = true }
oxc_diagnostics = { workspace = true }
oxc_module_lexer = { path = "../../crates/oxc_module_lexer" }
serde = { workspace = true }
serde_json = { workspace = true }
flexbuffers = { version = "2.0.0" }
tokio = { workspace = true }
napi = { workspace = true, features = ["serde-json", "async"] }
napi-derive = { workspace = true }
[build-dependencies]
napi-build = "2"
[package.metadata.cargo-machete]
ignored = ["napi"]