{"name":"oxc-transform","version":"0.34.0","keywords":["transform"],"author":{"name":"Boshen and oxc contributors"},"license":"MIT","_id":"oxc-transform@0.34.0","maintainers":[{"name":"boshen","email":"boshenc@gmail.com"}],"homepage":"https://oxc.rs","bugs":{"url":"https://github.com/oxc-project/oxc/issues"},"dist":{"shasum":"8fbabd15a4eb299dd6dfe4828f6e2a43bf553264","tarball":"http://registry-npm.ywwl.com/oxc-transform/download/oxc-transform-0.34.0.tgz","fileCount":5,"integrity":"sha512-yYYSqJFRlHI9yx1VbbS6e0a7yRGfv8Btrz+FYtO7WGx9L9UhBQVLZ3M//Ke9dwGM4gw1fBWk6sl5tDEjE5rJbA==","signatures":[{"sig":"MEQCICNsYS24Jr1XpixgHDYlTl9gf2635+AxxE/CyPM3xSrHAiAgcB1FCiTr9UUCupEi1GSlFxoGj/4vNrLHsrPnPd4HDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/oxc-transform@0.34.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":21122,"size":5632,"noattachment":false,"key":"/oxc-transform/-/oxc-transform-0.34.0.tgz"},"main":"index.js","_from":"file:oxc-transform-0.34.0.tgz","types":"./index.d.ts","funding":{"url":"https://github.com/sponsors/Boshen"},"_npmUser":{"name":"boshen","email":"boshenc@gmail.com"},"_resolved":"/tmp/06e525d906200b8174c88d58720e92c3/oxc-transform-0.34.0.tgz","_integrity":"sha512-yYYSqJFRlHI9yx1VbbS6e0a7yRGfv8Btrz+FYtO7WGx9L9UhBQVLZ3M//Ke9dwGM4gw1fBWk6sl5tDEjE5rJbA==","repository":{"url":"git+https://github.com/oxc-project/oxc.git","type":"git","directory":"npm/oxc-transform"},"_npmVersion":"10.8.2","description":"Oxc transform Node API","directories":{},"_nodeVersion":"22.7.0","_hasShrinkwrap":false,"optionalDependencies":{"@oxc-transform/binding-darwin-x64":"0.34.0","@oxc-transform/binding-darwin-arm64":"0.34.0","@oxc-transform/binding-linux-x64-gnu":"0.34.0","@oxc-transform/binding-linux-x64-musl":"0.34.0","@oxc-transform/binding-win32-x64-msvc":"0.34.0","@oxc-transform/binding-linux-arm64-gnu":"0.34.0","@oxc-transform/binding-linux-arm64-musl":"0.34.0","@oxc-transform/binding-win32-arm64-msvc":"0.34.0"},"_npmOperationalInternal":{"tmp":"tmp/oxc-transform_0.34.0_1729907253699_0.24577110111509848","host":"s3://npm-registry-packages"},"readme":"# Oxc Transform\n\nSee [usage instructions](https://oxc.rs/docs/guide/usage/transformer).\n\n## TypeScript and React JSX Transform\n\n```javascript\nimport assert from \"node:assert\";\nimport { transformSync } from \"oxc-transform\";\n\nconst { code, declaration, errors } = transformSync(\"test.ts\", \"class A<T> {}\", {\n  typescript: {\n    declaration: true, // With isolated declarations in a single step.\n  },\n});\n// or `await transform(filename, code, options)`\n\nassert.equal(code, \"class A {}\\n\");\nassert.equal(declaration, \"declare class A<T> {}\\n\");\nassert(errors.length == 0);\n```\n\n## [Isolated Declarations for Standalone DTS Emit](https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#isolated-declarations)\n\nConforms to TypeScript compiler's `--isolatedDeclarations` `.d.ts` emit.\n\n### Usage\n\n```javascript\nimport assert from \"node:assert\";\nimport { isolatedDeclarationSync } from \"oxc-transform\";\n\nconst { map, code, errors } = isolatedDeclarationSync(\"test.ts\", \"class A {}\");\n// or `await isolatedDeclaration(filename, code, options)`\n\nassert.equal(code, \"declare class A {}\\n\");\nassert(errors.length == 0);\n```\n\n### API\n\n#### Transform Functions\n\n```typescript\n// Synchronous transform\ntransformSync(\n  filename: string,\n  sourceText: string,\n  options?: TransformOptions,\n): TransformResult\n\n// Asynchronous transform\ntransform(\n  filename: string,\n  sourceText: string,\n  options?: TransformOptions,\n): Promise<TransformResult>\n```\n\n#### Isolated Declaration Functions\n\n```typescript\n// Synchronous isolated declaration\nisolatedDeclarationSync(\n  filename: string,\n  sourceText: string,\n  options?: IsolatedDeclarationsOptions,\n): IsolatedDeclarationsResult\n\n// Asynchronous isolated declaration\nisolatedDeclaration(\n  filename: string,\n  sourceText: string,\n  options?: IsolatedDeclarationsOptions,\n): Promise<IsolatedDeclarationsResult>\n```\n\nUse 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.\n\nSee `index.d.ts` for complete type definitions.\n\n### Supports WASM\n\nSee https://stackblitz.com/edit/oxc-transform for usage example.\n","publish_time":1729907253927,"_cnpm_publish_time":1729907253927,"dist-tags":{"latest":"0.159.0"}}