sucrase
Super-fast alternative to Babel for when you can target modern JS runtimes
Sucrase Explained
Sucrase is a super-fast code transformer for developers who want to skip Babel when building modern applications. Think of it as a lightweight alternative that handles TypeScript, JSX, and Flow — the language extensions that browsers and Node don't understand natively — without all the extra overhead Babel adds. It transforms these extensions into plain JavaScript that modern runtimes (recent browsers or Node versions) can actually run. If you're building for Internet Explorer or very old environments, this isn't for you; but if you're targeting modern systems, Sucrase can speed up your development builds dramatically.
Here's why it's so much faster: Babel does a lot of heavy lifting for every file it processes, even if you disable most features. It tokenizes your code, builds a giant abstract syntax tree (AST), analyzes scopes, applies transforms, and finally prints the result. Sucrase takes a shortcut. It uses a stripped-down parser that skips creating a full AST and instead does focused find-and-replace operations on the tokens themselves. For example, instead of building an entire syntax tree to understand JSX, it just finds <Foo and replaces it with React.createElement(Foo. Benchmarks show Sucrase is roughly 20 times faster than Babel on real-world codebases.
The tradeoff is flexibility. Sucrase only handles a specific set of transformations: JSX, TypeScript, Flow, CommonJS-to-ESM conversion, and a few modern JavaScript features (optional chaining, nullish coalescing, class fields). It won't validate your code for errors, it's not pluggable, and it processes files independently so some cross-file TypeScript features like const enums don't work. It's designed for development builds where you're using a linter or type checker anyway — and the README explicitly warns against relying on it for production.
You can use Sucrase as a drop-in replacement with ts-node, integrate it into webpack or Jest, or call it directly from JavaScript. Most developers reach for it when they want faster development iteration on TypeScript or React projects without sacrificing the ability to write modern syntax.