sucrase

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

Install

npm i sucrase
yarn add sucrase
pnpm add sucrase

Overview

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

Index

Functions

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;

      Interfaces

      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.

                              Badge

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

                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/sucrase.

                              • Markdown
                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/sucrase)
                              • HTML
                                <a href="https://www.jsdocs.io/package/sucrase"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>