High-performance JavaScript/TypeScript parser written in Zig, producing ESTree-compliant AST for JS/JSX and TypeScript-ESTree AST for TS/TSX. Features full support for Stage 3 decorators, import defer, import source, and hashbang. Provides fast offset-to-line/column resolution via locOf/locNear. Current stable version is 0.5.28. Released under Apache-2.0 license. Key differentiator: extreme speed (native Zig) while maintaining spec compliance identical to Acorn and @typescript-eslint/parser.
npm install yuku-parserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a JSX/TSX file, converts offset to line/column, and shows diagnostics.
Use import syntax or dynamic import().
Use import type ... from 'yuku-parser' for type annotations; do not import for runtime access.
When comparing with ESTree 'loc' values, lines are 1-based and columns 0-based.
Use locOf() to convert to line/column if byte positions are needed; otherwise handle UTF-16 offsets.
Check lang and sourceType options match the file content; ensure source is valid.
Switch to import { parse } from 'yuku-parser'; or use dynamic import().Use import type { Node } from 'yuku-parser'; for type-only imports.Ensure package is installed; set 'moduleResolution': 'node16' or 'nodenext' in tsconfig.