Yuku is a high-performance JavaScript and TypeScript compiler toolchain written in Zig. Spec-compliant, zero dependencies, fast by design.
Visit yuku.fyi for the full documentation, guides, and API reference.
npm install yuku-parserimport { parse } from "yuku-parser";
const { program, comments, diagnostics } = parse("const x = 1 + 2;");Outputs an ESTree / TS-ESTree-compatible AST matching Oxc. Runs 3-10x faster than alternatives on npm.
zig fetch --save git+https://github.com/yuku-toolchain/yuku.gitvar tree = try parser.parse(allocator, "const x = 5;", .{});
defer tree.deinit();Read the parser documentation →
npm install yuku-codegenimport { parse } from "yuku-parser";
import { generate } from "yuku-codegen";
generate(parse("const x = 1 + 2;").program).code;
// "const x = 1 + 2;"
generate(parse("const x: number = 1;", { lang: "ts" }).program, { strip: true }).code;
// "const x = 1;"
generate(parse("const enabled = true;").program, { minify: true }).code;
// "const enabled=!0"Emits a Source Map V3 in the same pass, ~2.5x faster than @babel/generator with source maps on:
const { program } = parse(source);
const { code, map } = generate(program, { sourceMap: { source } });Read the codegen documentation →
npm install yuku-analyzerimport { Analyzer } from "yuku-analyzer";
const project = new Analyzer();
project.addFile("a.ts", `export const value = 1;`);
project.addFile("b.ts", `export { value as renamed } from "./a.ts";`);
project.addFile("c.ts", `import { renamed } from "./b.ts"; renamed;`);
project.module("c.ts").rootScope.find("renamed").definition().symbol.name;
// "value"Scopes, symbols, resolved references, closures, and cross-file module linking, computed in one native pass.
Read the analyzer documentation →
Yuku prioritizes correctness while delivering top-tier speed and efficiency.
- Native benchmark (Zig/Rust) - faster than Oxc and SWC
- npm benchmark - 3-10x faster than alternatives
Correctness in Yuku is not an afterthought. Yuku is 100% ECMAScript spec compliant. The parser is validated against a dedicated parser test suite: over 55,000 cases sourced from Test262, the TypeScript compiler, and Babel, with exact AST matching against independently generated ESTree / TS-ESTree snapshots. The suite syncs with upstream daily, and Yuku passes all of it with zero failures and zero AST mismatches.
See CONTRIBUTING.md for setup, testing, and playground instructions.
Yuku is free and open-source software licensed under the MIT License.
