transformSync

Bun

Symbol

Transpiler.transformSync

transformSync(code: StringOrBuffer, loader: JavaScriptLoader, ctx: object): string

Transpile code from TypeScript or JSX into valid JavaScript. This function does not resolve imports.

@param code

The code to transpile

transformSync(code: StringOrBuffer, ctx: object): string

Transpile code from TypeScript or JSX into valid JavaScript. This function does not resolve imports.

@param code

The code to transpile

@param ctx

An object to pass to macros

Transpile code from TypeScript or JSX into valid JavaScript. This function does not resolve imports.

@param code

The code to transpile

Referenced types

type StringOrBuffer = string | NodeJS.TypedArray | ArrayBufferLike
type JavaScriptLoader = 'jsx' | 'js' | 'ts' | 'tsx'