Sucrase

Open source

Fast Babel alternative that compiles JSX, TypeScript and Flow for projects targeting modern browsers and recent Node.js versions.

sucrase.io
Sucrase homepage screenshot
GitHub stars
5.9k
Last 30 days
+5(+0%)
Last commit
1 yr ago
Repository age
9 years
Licence
MIT
Self-hosted
Yes

About Sucrase

Sucrase is a JavaScript compiler meant for development builds. It does not try to support old browsers such as Internet Explorer; it assumes a recent browser or Node.js and only handles non-standard syntax: JSX, TypeScript and Flow. That narrower scope lets it use a simpler architecture, at the cost of being less extensible than Babel.

Its parser is a trimmed fork of Babel's. You choose an array of transforms, such as jsx, typescript, flow, imports, react-hot-loader and jest. You can run it through a require hook with node -r sucrase/register, or plug it into ts-node as a transpiler. The README says it has built codebases such as Babel, React and Apollo client, about one million lines in total, with all tests passing.

Key features

  • Compiles JSX, TypeScript and Flow syntax
  • Strips TypeScript annotations without type checking
  • Converts ES modules to CommonJS
  • Runs through a Node require hook or the ts-node plugin
  • Hoists jest mock calls above imports
  • Transforms optional chaining and nullish coalescing by default

Good fit for

  • Fast TypeScript builds
  • Running TypeScript in Node
  • JSX compilation in dev builds
  • Jest test setup
Tags
compiler
typescript
jsx
flow
babel-alternative
javascript
build-tool

Sucrase: questions and answers

What is Sucrase used for?
Sucrase is a fast Babel alternative that compiles JSX, TypeScript and Flow for projects targeting modern browsers and recent Node.js versions. It is a good fit for fast TypeScript builds, running TypeScript in Node and JSX compilation in dev builds.
Is Sucrase open source?
Yes. Sucrase is open source under the MIT licence. Its source code is on GitHub at alangpierce/sucrase and is written mainly in TypeScript.
Is Sucrase free?
Yes. Sucrase is open source, so the software itself is free to use.
Can I self-host Sucrase?
Yes. Sucrase can be self-hosted on your own server or infrastructure.
Is Sucrase actively maintained?
The most recent commit to Sucrase was on 19 November 2025. The project has 5.9k stars on GitHub, with 5 added in the last 30 days.