{"name":"oxc-transform","version":"0.56.5","keywords":["oxc","transform"],"author":{"name":"Boshen and oxc contributors"},"license":"MIT","_id":"oxc-transform@0.56.5","maintainers":[{"name":"boshen","email":"boshenc@gmail.com"}],"homepage":"https://oxc.rs","bugs":{"url":"https://github.com/oxc-project/oxc/issues"},"dist":{"shasum":"22d011ea85d7a658a9eb173aac050187ebbb3f5c","tarball":"http://registry-npm.ywwl.com/oxc-transform/download/oxc-transform-0.56.5.tgz","fileCount":6,"integrity":"sha512-cLIZZqdwLpBBTZ9ILNpcGQUrqvgLKpo1+wx9CHimORs4Q6HUMjOYK65aZzyi5pIfBGzq0j3avK7rufpik0vzlA==","signatures":[{"sig":"MEQCIAS9u3MgZMe7aH7nGwTkubuqvpHYlj0tKYP/v7B7AVp9AiAmrTdhPVtON9BTFQXASF2ItKgeCI700vkRwyuhu7LfKw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/oxc-transform@0.56.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":26737,"size":6951,"noattachment":false,"key":"/oxc-transform/-/oxc-transform-0.56.5.tgz"},"main":"index.js","napi":{"wasm":{"browser":{"fs":true}},"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-threads"],"binaryName":"transform","packageName":"@oxc-transform/binding"},"_from":"file:oxc-transform-0.56.5.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/672d3c3d3d6c6bf7967d9b922b11fb69/oxc-transform-0.56.5.tgz","_integrity":"sha512-cLIZZqdwLpBBTZ9ILNpcGQUrqvgLKpo1+wx9CHimORs4Q6HUMjOYK65aZzyi5pIfBGzq0j3avK7rufpik0vzlA==","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,"optionalDependencies":{"@oxc-transform/binding-darwin-x64":"0.56.5","@oxc-transform/binding-wasm32-wasi":"0.56.5","@oxc-transform/binding-darwin-arm64":"0.56.5","@oxc-transform/binding-linux-x64-gnu":"0.56.5","@oxc-transform/binding-linux-x64-musl":"0.56.5","@oxc-transform/binding-win32-x64-msvc":"0.56.5","@oxc-transform/binding-linux-arm64-gnu":"0.56.5","@oxc-transform/binding-linux-arm64-musl":"0.56.5","@oxc-transform/binding-win32-arm64-msvc":"0.56.5","@oxc-transform/binding-linux-arm-gnueabihf":"0.56.5"},"_npmOperationalInternal":{"tmp":"tmp/oxc-transform_0.56.5_1741362410447_0.6231280745440666","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":1741362410637,"_cnpm_publish_time":1741362410637,"dist-tags":{"latest":"0.159.0"}}