Repolode
swc-project

swc-project/swc

A super-fast TypeScript/JavaScript compiler and parser written in Rust, usable from Rust and from JavaScript.

Open-source alternative to:Babel

Stars
34,194
Forks
1,547
Open issues
413
Last commit
13 hours ago

What is it?

SWC (Speedy Web Compiler) is a TypeScript and JavaScript compiler written in Rust. It parses, transforms and emits modern ECMAScript and TypeScript code, and is designed to be used as a library from both Rust and JavaScript. Most JavaScript users reach it through the @swc/core npm package, while Rust users can depend on the individual crates such as the ECMAScript parser.

The project positions itself as a faster alternative to Babel for compiling web code, and includes a comparison guide for migrating from Babel. Native npm packages are provided for x64 and arm64 macOS, Windows MSVC, and Linux GNU and musl. Supported Node.js versions are Node 10+ for usage and Node 20+ for development.

The Rust crates follow a published minimum supported Rust version (MSRV) of 1.73, and a helper script is provided to update all SWC crates in a Rust project.

Key features

  • 01Parses and compiles TypeScript and JavaScript written in modern ECMAScript syntax.
  • 02Usable as a Rust library through individual crates and as an npm package from JavaScript.
  • 03Ships native binaries for macOS, Windows MSVC and Linux (GNU and musl) on x64 and arm64.
  • 04Provides a migration guide and benchmarks comparing it with Babel.

Use cases

  • Replacing Babel in a JavaScript or TypeScript build pipeline to speed up compilation.
  • Building tooling in Rust that needs to parse or transform ECMAScript code.
  • Compiling TypeScript for web projects that target a range of Node.js versions.

Quick start

  1. 1

    Follow the installation guide on the swc.rs website for JavaScript usage

  2. 2

    For Rust usage, read the rustdoc and start from the parser crate

Things to know

  • Development of the project requires Node v20 or newer.
  • Rust crates have a minimum supported Rust version of 1.73.

Topics

FAQ

What is swc?
A super-fast TypeScript/JavaScript compiler and parser written in Rust, usable from Rust and from JavaScript. SWC (Speedy Web Compiler) is a TypeScript and JavaScript compiler written in Rust. It parses, transforms and emits modern ECMAScript and TypeScript code, and is designed to be used as a library from both Rust and JavaScript. Most JavaScript users reach it through the @swc/core npm package, while Rust users can depend on the individual crates such as the ECMAScript parser.
Is swc free to use? What license does it have?
swc is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is swc still maintained?
Actively maintained. The last commit to swc was on Oct 21, 2026.
What can I use swc for?
Replacing Babel in a JavaScript or TypeScript build pipeline to speed up compilation. Building tooling in Rust that needs to parse or transform ECMAScript code. Compiling TypeScript for web projects that target a range of Node.js versions.
How do I install swc?
Follow the installation guide on the swc.rs website for JavaScript usage For Rust usage, read the rustdoc and start from the parser crate
Where can I get swc?
The source code and installation instructions are on GitHub: https://github.com/swc-project/swc

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects