• Version 3.20.2
  • Published
  • 984 kB
  • 6 dependencies
  • MIT license


npm i sucrase
yarn add sucrase
pnpm add sucrase


Super-fast alternative to Babel for when you can target modern JS runtimes



function getFormattedTokens

getFormattedTokens: (code: string, options: Options) => string;
  • Return a string representation of the sucrase tokens, mostly useful for diagnostic purposes.

function getVersion

getVersion: () => string;

    function transform

    transform: (code: string, options: Options) => TransformResult;


      interface SucraseContext

      interface SucraseContext {}

        property helperManager

        helperManager: HelperManager;

          property importProcessor

          importProcessor: CJSImportProcessor | null;

            property nameManager

            nameManager: NameManager;

              property scopes

              scopes: Array<Scope>;

                property tokenProcessor

                tokenProcessor: TokenProcessor;

                  interface TransformResult

                  interface TransformResult {}

                    property code

                    code: string;

                      property sourceMap

                      sourceMap?: RawSourceMap;

                        Type Aliases

                        type Options

                        type Options = import('./Options').Options;

                          type SourceMapOptions

                          type SourceMapOptions = import('./Options').SourceMapOptions;

                            type Transform

                            type Transform = import('./Options').Transform;

                              Package Files (1)

                              Dependencies (6)

                              Dev Dependencies (20)

                              Peer Dependencies (0)

                              No peer dependencies.


                              To add a badge like this badgeto your package's README, use the codes available below.

                              You may also use to create a custom badge linking to

                              • Markdown
                              • HTML
                                <a href=""><img src="" alt=""></a>