Registry / other / swc-ecmascript

swc-ecmascript

JSON →
library59.0.0rscratesunverified

Ecmascript parsing, transformation, and code generation for the SWC compiler.

# Cargo.toml [dependencies] swc_ecmascript = "59.0.0"
INSTALL
IMPORT
SIG · SWC-ECMASCRIPT
S
swc-ecmascript
otherrustv59.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Parser
use swc_ecmascript::parser::Parser;

Parse ECMAScript code using SWC.

use swc_ecmascript::parser::{Parser, StringInput, Syntax}; fn main() { let input = StringInput::from("let x = 1;"); let mut parser = Parser::new(Syntax::default(), input); let module = parser.parse_module().unwrap(); }
Debug
Known issues
gotchaRequires the `parser` feature to be enabled.
fix
Add `features = ["parser"]` to your Cargo.toml dependency.
affects: >=0.1.0
Upgrade
Version history
59.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Resources
swc-ecmascript — cargo add swc-ecmascript · libregistry