{"_id":"yuku@0.27.0","bugs":{"url":"https://github.com/yuku-toolchain/yuku/issues"},"dist":{"shasum":"fc227eb21a9be32203227b8ee15b8ea84ad90cb8","tarball":"http://registry-npm.ywwl.com/yuku/download/yuku-0.27.0.tgz","fileCount":13,"integrity":"sha512-YmSD4xYlESRi8egxzC4guegQdMhAcz1G9NUsMNrTABAIV9dQxoBzDC7ZyAG/dSG18o1Oxt4xDok2irvPy9FSJQ==","signatures":[{"sig":"MEUCIQCfgNNvex6emTLpMb9sjCrAe1CidACfuBYHQn/tkliTlgIgH36lhLg/FNqLKfXsyqHmePX5qyM5Lv7QSJaBcoIFQMo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEPxq2DbBi+EZ3bYVlHaSJEbR5fmQub6jjuHe47m9Pn9AiEA9iLIwpaolCOsuu0uewwpzUEQnuVBiPOkEpaWGNdsqZ4="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/yuku@0.27.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2717990,"size":658970,"noattachment":false,"key":"/yuku/-/yuku-0.27.0.tgz"},"main":"./dist/index.js","name":"yuku","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":"3c1d1ac0be2c21b1cc750cfeb6e1127c52e89e0c","imports":{"#wasm":{"bun":"./dist/wasm/inline.js","deno":"./dist/wasm/inline.js","node":"./dist/wasm/read.js","module":"./dist/wasm/inline.js","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"}},"license":"MIT","scripts":{"build":"tsdown"},"version":"0.27.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"46267f48-76d0-4654-b6f5-3892283f9cdb"}},"homepage":"https://yuku.fyi","keywords":["analyzer","ast","codegen","compiler","ecmascript","estree","javascript","jsx","minifier","parser","scope","sourcemap","tokenizer","typescript","walker","webassembly"],"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":{},"maintainers":[{"name":"arshadyaseen","email":"arshadpyaseen@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"tsdown":"0.23.0"},"peerDependencies":{"@yuku-toolchain/wasm":"0.27.0"},"optionalDependencies":{"@yuku-toolchain/linux-x64":"0.27.0","@yuku-toolchain/win32-x64":"0.27.0","@yuku-toolchain/darwin-x64":"0.27.0","@yuku-toolchain/linux-arm64":"0.27.0","@yuku-toolchain/win32-arm64":"0.27.0","@yuku-toolchain/darwin-arm64":"0.27.0"},"peerDependenciesMeta":{"@yuku-toolchain/wasm":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/yuku_0.27.0_1793619597068_0.899565448719872"},"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":1793619597213,"_cnpm_publish_time":1793619597213,"dist-tags":{"latest":"0.28.0"}}