Skip to content

Lanexio Parser

One function. Eleven languages. Zero copies. Lanexio Parser is a modular, universal parsing framework built around a single, auto-detecting entry point. Hand it bytes — it identifies the format, routes to the right grammar, and returns a standardized, zero-copy syntax tree. Your application logic never needs to know what language it just parsed.

One API, every format

HTML, Markdown, YAML, JSON, CSS, CSV, GraphQL, TOML, XML, MDX, SQL — all behind the same parse() function with the same return shape and the same traversal API. Write your parse logic once and it works everywhere.

Zero-copy flat AST

Sixteen bytes per node. One ArrayBuffer for the entire tree. No per-node object allocation. No string copying. No GC pressure. O(1) subtree skip in preorder DFS. Fast because there’s nothing to allocate.

Install only what you need

Eleven independent packages under @lanexio/parser-grammar-*. Need HTML and Markdown? Install two. Don’t need SQL? Don’t install it. The universal entry point discovers what’s available at runtime.

Never throws. Never panics.

Malformed input produces LexError nodes — never an exception. Backed by 20 billion fuzz cases across 13 continuous-soak harnesses. Pass any byte sequence of any length and get a valid tree back.

Runs everywhere

No DOM dependency. No Node-specific APIs in the parse path. No framework imports. Browser, server, edge worker, test runner — same code, same guarantees.

Conformance with receipts

100% html5lib. 100% CommonMark + GFM. 100% yaml-test-suite. Every grammar carries its numbers publicly, and every number is an exact-count gate — if it regresses, the build fails.

FormatPackageHighlights
HTML@lanexio/parser-grammar-html100% html5lib, all 23 insertion modes, adoption agency, sanitization
Markdown@lanexio/parser-grammar-markdown100% CommonMark 0.31.2 + GFM, serializer, text-content extractor
MDX@lanexio/parser-grammar-mdxMarkdown + JSX + ESM + expressions, built on the Markdown engine
YAML@lanexio/parser-grammar-yaml100% yaml-test-suite (268 structural, 82 error rejection)
JSON@lanexio/parser-grammar-jsonRFC 8259, JSONC, JSON5 — three dialects in one package
CSS@lanexio/parser-grammar-cssCSS Syntax Level 3, value validation, multi-stylesheet support
CSV@lanexio/parser-grammar-csvRFC 4180, configurable delimiters and quoting, CSV + TSV
GraphQL@lanexio/parser-grammar-graphqlAuto-detects executable vs SDL, lenient parsing
TOML@lanexio/parser-grammar-tomlTOML v1.0.0 and v1.1.0 with version selection
XML@lanexio/parser-grammar-xmlXML 1.0 5th Edition, optional DTD validation, multi-byte encodings
SQL@lanexio/parser-grammar-sqlDialect-aware: PostgreSQL, MySQL, SQLite, T-SQL