{"name":"yuku","version":"0.25.0","keywords":["analyzer","ast","codegen","compiler","ecmascript","estree","javascript","jsx","minifier","parser","scope","sourcemap","tokenizer","typescript","walker","webassembly"],"license":"MIT","_id":"yuku@0.25.0","maintainers":[{"name":"arshadyaseen","email":"arshadpyaseen@gmail.com"}],"homepage":"https://yuku.fyi","bugs":{"url":"https://github.com/yuku-toolchain/yuku/issues"},"dist":{"shasum":"dd90e620b6c44b9bfaf232fcf63d79603d3fa40d","tarball":"http://registry-npm.ywwl.com/yuku/download/yuku-0.25.0.tgz","fileCount":12,"integrity":"sha512-iAlHlpPmcjRqUauDkW9xF33b+jsUzTrrv49FfPLBNxEAUWuU7XN8tBUGjBHYPCEF/d3632MhG6GjCZutecA8Ng==","signatures":[{"sig":"MEUCIQCnwb/c0DKG0xgp3EVFnLxnVYldu4Zl3pLLzVsvV2PLrAIgCwJU5n/eG6EctDBLNBA5nmzgB5znKu0fow8ffzlNq2U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCGFoJdj9wCdfON78T8Oido4qjgmIDXHT05R2tbK30CJAIhAOTnmtb5A4kQvGBxToJ3HktZxGqrJ2AHMZmbIBy4tu7c","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/yuku@0.25.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2186458,"size":547022,"noattachment":false,"key":"/yuku/-/yuku-0.25.0.tgz"},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=16.4.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./utils":{"types":"./dist/utils.d.ts","default":"./dist/utils.js"},"./package.json":"./package.json"},"gitHead":"d48ef0871ea83a6472e1baac8921bc1fcf926bd6","imports":{"#wasm":{"default":"./dist/wasm/inline.js","workerd":"./dist/wasm/import.js","edge-light":"./dist/wasm/import.js"},"#native":{"node":"./dist/native/addons.js","default":"./dist/native/none.js"}},"scripts":{"build":"tsdown"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"46267f48-76d0-4654-b6f5-3892283f9cdb"}},"repository":{"url":"git+https://github.com/yuku-toolchain/yuku.git","type":"git","directory":"npm/yuku"},"_npmVersion":"11.16.0","description":"A JavaScript and TypeScript compiler toolchain written in Zig","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"tsdown":"0.23.0"},"peerDependencies":{"@yuku-toolchain/wasm":"0.25.0"},"optionalDependencies":{"@yuku-toolchain/linux-x64":"0.25.0","@yuku-toolchain/win32-x64":"0.25.0","@yuku-toolchain/darwin-x64":"0.25.0","@yuku-toolchain/linux-arm64":"0.25.0","@yuku-toolchain/win32-arm64":"0.25.0","@yuku-toolchain/darwin-arm64":"0.25.0"},"peerDependenciesMeta":{"@yuku-toolchain/wasm":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/yuku_0.25.0_1793261579248_0.6307052775792356","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n\n<img src=\"https://raw.githubusercontent.com/yuku-toolchain/yuku/main/docs/assets/logo.svg\" alt=\"Yuku\" width=\"260\" />\n\n<br />\n<br />\n\n**Parse, analyze, walk, build, and print JavaScript and TypeScript.**\n\nOne package, no third-party dependencies. Written in Zig, running in Node.js, Bun, Deno, browsers, and edge runtimes.\n\n[Docs](https://yuku.fyi/javascript/) · [Playground](https://playground.yuku.fyi) · [GitHub](https://github.com/yuku-toolchain/yuku)\n\n</div>\n\n```bash\nnpm install yuku\n```\n\nIt runs natively where its addon for the platform installs, and as WebAssembly everywhere else. Cloudflare Workers and Vercel Edge run WebAssembly only from a file, so there also install `@yuku-toolchain/wasm`.\n\n```js\nimport { b, parse, print, walk } from \"yuku\";\n\nconst file = parse(`\n  const RATE = 0.2;\n  export const tax = (price: number) => price * RATE;\n  export const scale = (RATE: number) => RATE * 2;\n`, { path: \"tax.ts\", analyze: true });\n\nconst rate = file.rootScope.find(\"RATE\");\n\nwalk(file.program, {\n  Identifier(node, ctx) {\n    if (file.referenceOf(node)?.binding === rate) ctx.replace(b.Literal({ value: 0.2 }));\n  },\n});\n\nprint(file, { strip: true }).code;\n// const RATE = 0.2;\n// export const tax = (price) => price * 0.2;\n// export const scale = (RATE) => RATE * 2;\n```\n\nThe [guide](https://yuku.fyi/javascript/) documents how to [parse](https://yuku.fyi/javascript/parse/), [walk and build](https://yuku.fyi/javascript/walk/), [analyze](https://yuku.fyi/javascript/semantic/), and [print](https://yuku.fyi/javascript/print/).\n\n## Performance\n\n`yuku` parses faster than the alternatives on npm, on small and large files.\n\n![Parsing react.js (70 KB) on npm](https://raw.githubusercontent.com/yuku-toolchain/ecmascript-parser-benchmark-js/refs/heads/main/charts/react.svg)\n\n![Parsing typescript.js (7.8 MB) on npm](https://raw.githubusercontent.com/yuku-toolchain/ecmascript-parser-benchmark-js/refs/heads/main/charts/typescript.svg)\n\nAnalyzing a whole codebase, it is faster than typescript-eslint and the TypeScript API, and on a single large file too.\n\n![Analyzing three.js (755 files) on npm](https://raw.githubusercontent.com/yuku-toolchain/ecmascript-analyzer-benchmark-js/refs/heads/main/charts/three.svg)\n\n![Analyzing typescript.js (7.8 MB) on npm](https://raw.githubusercontent.com/yuku-toolchain/ecmascript-analyzer-benchmark-js/refs/heads/main/charts/typescript_js.svg)\n\nMeasured on an Apple M3, see the [parser](https://github.com/yuku-toolchain/ecmascript-parser-benchmark-js) and [analyzer](https://github.com/yuku-toolchain/ecmascript-analyzer-benchmark-js) benchmarks. Pass one `walk` all your visitors.\n\n## License\n\nMIT\n","publish_time":1793261579425,"_cnpm_publish_time":1793261579425,"dist-tags":{"latest":"0.28.0"}}