
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
oxc-transform
Advanced tools
This is alpha software and may yield incorrect results, feel free to submit a bug report.
import assert from 'assert';
import oxc from 'oxc-transform';
const { code, declaration, errors } = oxc.transform(
'test.ts',
'class A<T> {}',
{
typescript: {
declaration: true, // With isolated declarations in a single step.
},
},
);
assert.equal(code, 'class A {}\n');
assert.equal(declaration, 'declare class A<T> {}\n');
assert(errors.length == 0);
Conforms to TypeScript compiler's --isolatedDeclarations
.d.ts
emit.
import assert from 'assert';
import oxc from 'oxc-transform';
const { map, code, errors } = oxc.isolatedDeclaration('test.ts', 'class A {}');
assert.equal(code, 'declare class A {}\n');
assert(errors.length == 0);
See index.d.ts
.
export declare function transform(
filename: string,
sourceText: string,
options?: TransformOptions,
): TransformResult;
export function isolatedDeclaration(
filename: string,
sourceText: string,
options?: IsolatedDeclarationsOptions,
): IsolatedDeclarationsResult;
See https://stackblitz.com/edit/oxc-transform for usage example.
FAQs
Oxc Transformer Node API
The npm package oxc-transform receives a total of 113,788 weekly downloads. As such, oxc-transform popularity was classified as popular.
We found that oxc-transform demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.