{"name":"oxc-transform","version":"0.56.1","keywords":["oxc","transform"],"author":{"name":"Boshen and oxc contributors"},"license":"MIT","_id":"oxc-transform@0.56.1","maintainers":[{"name":"boshen","email":"boshenc@gmail.com"}],"homepage":"https://oxc.rs","bugs":{"url":"https://github.com/oxc-project/oxc/issues"},"dist":{"shasum":"3ac5ebb8c767ce585dccedbfd89373e8e0688f4e","tarball":"http://registry-npm.ywwl.com/oxc-transform/download/oxc-transform-0.56.1.tgz","fileCount":6,"integrity":"sha512-AH7aJ60RNnaySLtzMaJzx3tPOnpbfP8SCaTzfUYhqIjaXoGuzlK8DuH8LFyYyZSoDjMPMiPK4NphBhCbKqDBMw==","signatures":[{"sig":"MEUCIQC92M1H4TcPRaTLpv8qLpC2KHcf3jxOmHaqH+WJOWW4/QIgUg/2PbCoslP6xedcvgmooUuhfiwbrAWqfQAUEUo8GqQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/oxc-transform@0.56.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":26080,"size":6861,"noattachment":false,"key":"/oxc-transform/-/oxc-transform-0.56.1.tgz"},"main":"index.js","napi":{"targets":["x86_64-pc-windows-msvc","aarch64-pc-windows-msvc","x86_64-unknown-linux-gnu","x86_64-unknown-linux-musl","aarch64-unknown-linux-gnu","aarch64-unknown-linux-musl","armv7-unknown-linux-gnueabihf","x86_64-apple-darwin","aarch64-apple-darwin","wasm32-wasip1"],"binaryName":"transform","packageName":"@oxc-transform/binding"},"_from":"file:oxc-transform-0.56.1.tgz","types":"./index.d.ts","browser":"browser.js","engines":{"node":">=14.0.0"},"funding":{"url":"https://github.com/sponsors/Boshen"},"_npmUser":{"name":"boshen","email":"boshenc@gmail.com"},"_resolved":"/tmp/ffa572e60bd08e4a62b1256813d835af/oxc-transform-0.56.1.tgz","_integrity":"sha512-AH7aJ60RNnaySLtzMaJzx3tPOnpbfP8SCaTzfUYhqIjaXoGuzlK8DuH8LFyYyZSoDjMPMiPK4NphBhCbKqDBMw==","repository":{"url":"git+https://github.com/oxc-project/oxc.git","type":"git","directory":"npm/oxc-transform"},"_npmVersion":"10.9.2","description":"Oxc transform Node API","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/oxc-transform_0.56.1_1741320928622_0.24949435860312996","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":1741320928881,"_cnpm_publish_time":1741320928881,"dist-tags":{"latest":"0.159.0"}}