One API, every format
HTML, Markdown, YAML, JSON, CSS, CSV, GraphQL, TOML, XML, MDX, SQL. All sit behind the same parse() function with the same return shape and the same traversal API. Write your parse logic once and it works everywhere.
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 sit 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 is nothing to allocate.
Install only what you need
Eleven independent packages under @lanexio/parser-grammar-*. Need HTML and Markdown? Install two. Do not need SQL? Do not install it. The universal entry point discovers what is available at runtime.
Never throws. Never panics.
Malformed input produces LexError nodes, never an exception. 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.
Numbers you can verify
The curated suites gate in CI with ledger-backed exact counts: toml-test (268 valid plus 511 invalid), W3C xmlts, CommonMark 0.31.2, and the dedicated html5lib runner (1,778 tests). Every count is public on the conformance pages. If a count regresses, the build fails.
| Format | Package | Highlights |
|---|---|---|
| HTML | @lanexio/parser-grammar-html | All 23 insertion modes, adoption agency, DOM-shaped facade |
| Markdown | @lanexio/parser-grammar-markdown | CommonMark 0.31.2 gate, serializer, text-content extractor |
| MDX | @lanexio/parser-grammar-mdx | Markdown + JSX + ESM + expressions, built on the Markdown engine |
| YAML | @lanexio/parser-grammar-yaml | yaml-test-suite exact-count gate (268 valid, 82 error) |
| JSON | @lanexio/parser-grammar-json | RFC 8259, JSONC, JSON5: three dialects in one package |
| CSS | @lanexio/parser-grammar-css | CSS Syntax Level 3, multi-stylesheet support |
| CSV | @lanexio/parser-grammar-csv | RFC 4180, configurable delimiters and quoting, CSV + TSV |
| GraphQL | @lanexio/parser-grammar-graphql | Auto-detects executable vs SDL, lenient parsing |
| TOML | @lanexio/parser-grammar-toml | TOML v1.0.0 and v1.1.0 with version selection |
| XML | @lanexio/parser-grammar-xml | XML 1.0 5th Edition, optional DTD validation, multi-byte encodings |
| SQL | @lanexio/parser-grammar-sql | Dialect-aware: PostgreSQL, MySQL, SQLite, T-SQL |