kach/nearley
📜🔜🌲 Simple, fast, powerful parser toolkit for JavaScript. observed · 2026-08-28
Health v2 · maintenance only
23/100
- Activity 0
- Release rhythm 8
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 4574
- days_rel: n/a
- days_push: 658
- n_releases_24m: 0
Adoption not part of the score
3742 stars · 235 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
nearley is a JavaScript parser toolkit built on the Earley parsing algorithm, consisting of a BNF-based grammar DSL compiler and a lightweight streaming parser runtime. It handles any context-free grammar including left-recursive and ambiguous ones, works in Node.js and browsers, and ships with tooling for testing, unparser-based fuzzing, and railroad diagram generation.
Use cases
- parse a custom DSL or configuration file format in JavaScript
- build a compiler frontend for a programming language
- parse file formats that PEG.js or Jison choke on, like left-recursive grammars
- handle ambiguous grammars and get all possible parse trees
- write a streaming parser for a REPL that consumes input incrementally
- generate railroad diagrams to document a grammar
- generate random valid strings from a grammar for fuzz testing
- teach or study parsing algorithms and computational linguistics
When to choose
- you need to parse arbitrary or ambiguous context-free grammars, including left recursion
- you want a streaming parser with graceful error handling in Node or the browser
- you need all possible parsings for an ambiguous grammar
- you want tooling like fuzzers, railroad diagrams, and grammar tests out of the box
- you're building a DSL, markup language, or small language compiler in JavaScript
When to avoid
- you need maximum parsing speed on simple LL(k) grammars where hand-written or PEG parsers are faster
- you want automatic AST generation with minimal boilerplate rather than writing postprocessors
- you're parsing a well-known format like JSON where a dedicated parser is simpler
- you need parser combinators or a runtime grammar-construction API instead of a compiled grammar file
Facets
library · maturity stable
parser compiler developer-tools parsers programming-languages developer-tools browser cross-platform earley-algorithm parser-generator grammar-dsl streaming-parser ambiguous-grammars lexer-integration railroad-diagrams fuzzing scannerless-parsing natural-language-processing nodejs javascript
10 sources
- readme: https://github.com/kach/nearley · fetched 2026-08-28 · a90accbfc661
- homepage: https://nearley.js.org · fetched 2026-08-29 · 6e3b2b7204ea
- site_page: https://nearley.js.org/docs/getting-started · fetched 2026-08-29 · d9ca49c3eccf
- site_page: https://nearley.js.org/docs/grammar · fetched 2026-08-29 · a25ee01b3fc3
- site_page: https://nearley.js.org/docs/parser · fetched 2026-08-29 · ee81b9a6c046
- site_page: https://nearley.js.org/docs/tokenizers · fetched 2026-08-29 · 51ef5cc85233
- site_page: https://nearley.js.org/docs/tooling · fetched 2026-08-29 · 7cba1da5ef37
- site_page: https://nearley.js.org/docs/how-to-grammar-good · fetched 2026-08-29 · 1f667060a658
- site_page: https://nearley.js.org/docs/using-in-frontend · fetched 2026-08-29 · 6af895a27794
- site_page: https://nearley.js.org/docs/glossary · fetched 2026-08-29 · 7bc89118cd69
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| kach/nearley | main | 23 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem