Guide/Overview

SWC Next

SWC Next is a fast JavaScript and TypeScript toolchain written in Rust, focused on performance and JavaScript extensibility.

Features

  • Fast. Around 3× faster than SWC in native parser benchmarks and 8× in JavaScript parser benchmarks.
  • JavaScript plugins. Inspect and transform ESTree-compatible ASTs using JavaScript.
  • Correct. Passes 100% of the Test262 parser conformance suite. See results.
  • Node.js and browsers. Native bindings for Node.js and WebAssembly for the browser.

Get started

npm install @swc-next/core

Parse a program and print it back to source:

index.mjs
import { parseSync, printSync } from "@swc-next/core";

const { program } = parseSync("const answer = 42;");
console.log(printSync(program).code); // const answer = 42;

See Install for browser setup, or explore the JavaScript API.

SWC Next is under development. See Project status for available features and the Roadmap for planned work.