Sucrase is a high-speed transpilation tool that compiles modern JavaScript, TypeScript, JSX, and Flow to standard JavaScript for modern runtimes. It operates as a fast alternative to Babel, using a single-pass scanner and tokenizer that strips type annotations and applies only requested syntax transforms without building an AST or performing type checking.
The tool differentiates itself through a zero-type-checking pipeline that omits type checking entirely, relying on the assumption that input code is already valid for the target runtime. It uses scanner-based tokenization and single-pass code generation to produce output from the token stream without building an intermediate representation, and applies only transform-selective compilation for JSX, TypeScript, Flow, and imports while leaving other modern syntax unchanged.
Sucrase provides a command-line interface for running code directly, mirroring directories with transforms, and integrating into build tool workflows. It supports syntax-level transforms for converting TypeScript, Flow, JSX, modern JavaScript, and ES modules into standard JavaScript, including ES module conversion to CommonJS, JSX compilation for React, and removal of Flow and TypeScript type annotations. The tool integrates with Webpack, Gulp, Jest, Rollup, and Broccoli via direct API calls without requiring a plugin system.