You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

oxc-transform

Package Overview
Dependencies
Maintainers
1
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oxc-transform

Oxc Transformer Node API

Source
npmnpm
Version
0.107.0
Version published
Weekly downloads
2.7M
2.39%
Maintainers
1
Weekly downloads
 
Created
Source

Oxc Transform

This is alpha software and may yield incorrect results, feel free to submit a bug report.

TypeScript and React JSX Transform

import assert from 'assert';
import { transformSync } from 'oxc-transform';

const { code, declaration, errors } = transformSync(
  'test.ts',
  'class A<T> {}',
  {
    typescript: {
      declaration: true, // With isolated declarations in a single step.
    },
  },
);
// or `await transform(filename, code, options)`

assert.equal(code, 'class A {}\n');
assert.equal(declaration, 'declare class A<T> {}\n');
assert(errors.length == 0);

Isolated Declarations for Standalone DTS Emit

Conforms to TypeScript compiler's --isolatedDeclarations .d.ts emit.

Usage

import assert from 'assert';
import { isolatedDeclarationSync } from 'oxc-transform';

const { map, code, errors } = isolatedDeclarationSync('test.ts', 'class A {}');
// or `await isolatedDeclaration(filename, code, options)`

assert.equal(code, 'declare class A {}\n');
assert(errors.length == 0);

API

Transform Functions

// Synchronous transform
transformSync(
  filename: string,
  sourceText: string,
  options?: TransformOptions,
): TransformResult

// Asynchronous transform
transform(
  filename: string,
  sourceText: string,
  options?: TransformOptions,
): Promise<TransformResult>

Isolated Declaration Functions

// Synchronous isolated declaration
isolatedDeclarationSync(
  filename: string,
  sourceText: string,
  options?: IsolatedDeclarationsOptions,
): IsolatedDeclarationsResult

// Asynchronous isolated declaration
isolatedDeclaration(
  filename: string,
  sourceText: string,
  options?: IsolatedDeclarationsOptions,
): Promise<IsolatedDeclarationsResult>

Use the Sync versions for synchronous operations. Use async versions for asynchronous operations, which can be beneficial in I/O-bound or concurrent scenarios, though they add async overhead.

See index.d.ts for complete type definitions.

Supports WASM

See https://stackblitz.com/edit/oxc-transform for usage example.

Keywords

oxc

FAQs

Package last updated on 05 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts