{"name":"oxc-transform","version":"0.40.1","keywords":["transform"],"author":{"name":"Boshen and oxc contributors"},"license":"MIT","_id":"oxc-transform@0.40.1","maintainers":[{"name":"boshen","email":"boshenc@gmail.com"}],"homepage":"https://oxc.rs","bugs":{"url":"https://github.com/oxc-project/oxc/issues"},"dist":{"shasum":"f9cfa5c93822b708c219aa69f0962aca30b3ac82","tarball":"http://registry-npm.ywwl.com/oxc-transform/download/oxc-transform-0.40.1.tgz","fileCount":5,"integrity":"sha512-vTuZmdMZjmbVOcwx7INR2edFOxschiK7P32SlYTP1JHtAax3f92cDdHKS3uv8Sch75HFlKdaegxGo7xI4Vmqcw==","signatures":[{"sig":"MEUCIQDLXtB4yYIlr06uuLvAcun7LX6dlcT86+Wh5EiJ9PWmUwIgT2vTvb61SgAZwkNSo+iKm+RHNRp1S5pP7NlqAGBYoo4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/oxc-transform@0.40.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":22963,"size":6237,"noattachment":false,"key":"/oxc-transform/-/oxc-transform-0.40.1.tgz"},"main":"index.js","_from":"file:oxc-transform-0.40.1.tgz","types":"./index.d.ts","funding":{"url":"https://github.com/sponsors/Boshen"},"_npmUser":{"name":"boshen","email":"boshenc@gmail.com"},"_resolved":"/tmp/b7b68e67f19b444e5d988cfdbb226eef/oxc-transform-0.40.1.tgz","_integrity":"sha512-vTuZmdMZjmbVOcwx7INR2edFOxschiK7P32SlYTP1JHtAax3f92cDdHKS3uv8Sch75HFlKdaegxGo7xI4Vmqcw==","repository":{"url":"git+https://github.com/oxc-project/oxc.git","type":"git","directory":"npm/oxc-transform"},"_npmVersion":"10.9.0","description":"Oxc transform Node API","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"optionalDependencies":{"@oxc-transform/binding-darwin-x64":"0.40.1","@oxc-transform/binding-darwin-arm64":"0.40.1","@oxc-transform/binding-linux-x64-gnu":"0.40.1","@oxc-transform/binding-linux-x64-musl":"0.40.1","@oxc-transform/binding-win32-x64-msvc":"0.40.1","@oxc-transform/binding-linux-arm64-gnu":"0.40.1","@oxc-transform/binding-linux-arm64-musl":"0.40.1","@oxc-transform/binding-win32-arm64-msvc":"0.40.1"},"_npmOperationalInternal":{"tmp":"tmp/oxc-transform_0.40.1_1733849391889_0.11436780807761582","host":"s3://npm-registry-packages-npm-production"},"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":1733849392220,"_cnpm_publish_time":1733849392220,"dist-tags":{"latest":"0.159.0"}}