Telarel
An extensible JavaScript compiler written in Rust, and built around plugin hooks.
import type { CodeResult } from "telarel";
import { compile } from "telarel";
const result: CodeResult = await compile("const x: number = 1;");use telarel::{CodeResult, CompileOptions, compile};
let result: CodeResult = compile(
String::from("const x: number = 1;"),
CompileOptions::default(),
vec![],
)
.await?;Native speed
The compiler is written in Rust and built on oxc, so compilation runs in native code. There is no JavaScript reimplementation behind the JavaScript API.
Hook-based pipeline
Different return-based hooks — options, start, parse, prepare, transform, finalize, generate, and end — over one shared pipeline. A plugin implements any subset; the rest are skipped.
Plugins in JavaScript & Rust
Extend the pipeline from either side: JavaScript plugin objects bridge to the same Rust contract, and both languages set per-hook pre, normal, or post order.
Opt-in Transform
Lower TypeScript, JSX, and modern syntax with the built-in transform plugin — or leave it out. compile without it still parses and regenerates your source unchanged.
JavaScript and Rust APIs
The same compiler is exposed as the telarel crate and as the telarel npm package via a NAPI binding, with the same functions and shared types.
Composable entry points
parse, rewrite, generate, compileFromAst, and compile share one pipeline, each running only the stages it owns, so you can stop at an AST and resume later.
Copyright © 2026, Alpheus