{"name":"yuku","version":"0.2.9","author":{"url":"https://arshad.fyi","name":"Arshad Yaseen","email":"arshadpyaseen@gmail.com"},"license":"MIT","_id":"yuku@0.2.9","maintainers":[{"name":"arshadyaseen","email":"arshadpyaseen@gmail.com"}],"homepage":"https://yuku.fyi","bugs":{"url":"https://github.com/arshad-yaseen/yuku/issues"},"dist":{"shasum":"0da40e255f95f0aef9d78793e72d1022535899f2","tarball":"http://registry-npm.ywwl.com/yuku/download/yuku-0.2.9.tgz","fileCount":6,"integrity":"sha512-A497XCvkg2wnnHcU/p7063cBlVya3hTbd/35QwPRhc/AxHtK8dxiqNf40dFaiL7XJXE0nW/a43m4GMl8OroJFQ==","signatures":[{"sig":"MEUCIQDXcGoehmVFutbX5MFCHC2A+jABRra2MbjOujINaQIGvgIgJhab0CqAh16k1dv/uq4RpHaT0+YxYBzCwoIw2zWLEdA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/yuku@0.2.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":360461,"size":122270,"noattachment":false,"key":"/yuku/-/yuku-0.2.9.tgz"},"type":"module","_from":"file:yuku-0.2.9.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./browser":{"types":"./dist/browser.d.ts","default":"./dist/browser.js"},"./package.json":"./package.json"},"funding":"https://github.com/sponsors/arshad-yaseen","scripts":{"build":"tsgo && cp ../zig-out/bin/yuku.wasm dist"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4c447546-5315-4d2f-97a7-3d7a84bf34fa"}},"_resolved":"/home/runner/work/yuku/yuku/npm/yuku-0.2.9.tgz","_integrity":"sha512-A497XCvkg2wnnHcU/p7063cBlVya3hTbd/35QwPRhc/AxHtK8dxiqNf40dFaiL7XJXE0nW/a43m4GMl8OroJFQ==","repository":{"url":"git+https://github.com/arshad-yaseen/yuku.git","type":"git"},"_npmVersion":"11.8.0","description":"A very fast JavaScript/TypeScript parser written in Zig","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.5","@typescript/native-preview":"^7.0.0-dev.20260109.1"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/yuku_0.2.9_1770195461630_0.8864084458771797","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":1770195461760,"_cnpm_publish_time":1770195461760,"dist-tags":{"latest":"0.28.0"}}