Registry / build-tool / swc-ecma-codegen

swc-ecma-codegen

JSON →
library8.0.1rscratesunverified

Ecmascript code generator for the swc project.

# Cargo.toml [dependencies] swc_ecma_codegen = "8.0.1"
INSTALL
IMPORT
SIG · SWC-ECMA-CODEGEN
S
swc-ecma-codegen
build-toolrustv8.0.1
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.

Emitter
use swc_ecma_codegen::Emitter;

Emits ECMAScript code from an AST module.

use swc_ecma_codegen::Emitter; use swc_ecma_ast::Module; fn main() { let module = Module { body: vec![], span: Default::default() }; let mut buf = Vec::new(); let mut emitter = Emitter::new(&mut buf); emitter.emit_module(&module).unwrap(); println!("{}", String::from_utf8_lossy(&buf)); }
Debug
Known issues
gotchaRequires the swc_ecma_ast crate for AST types; not included by default.
fix
Add swc_ecma_ast to your dependencies.
affects: >=8.0.0
Upgrade
Version history
8.0.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
26
Amazon
1
OpenAI (training)
1
Resources
swc-ecma-codegen — cargo add swc-ecma-codegen · libregistry