{"id":13454696,"url":"https://github.com/kach/nearley","last_synced_at":"2025-12-23T01:05:08.841Z","repository":{"id":490709,"uuid":"17116619","full_name":"kach/nearley","owner":"kach","description":"📜🔜🌲 Simple, fast, powerful parser toolkit for JavaScript.","archived":false,"fork":false,"pushed_at":"2024-11-14T02:34:00.000Z","size":2360,"stargazers_count":3685,"open_issues_count":198,"forks_count":234,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-05-13T18:22:50.911Z","etag":null,"topics":["earley-algorithm","earley-parser","javascript","nearley","node","nodejs","parser","parsing","parsing-library"],"latest_commit_sha":null,"homepage":"https://nearley.js.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-02-23T20:44:28.000Z","updated_at":"2025-05-13T01:29:15.000Z","dependencies_parsed_at":"2024-06-18T10:58:20.552Z","dependency_job_id":"860c37d6-5aaa-46ec-b6e0-4ce7a46402a9","html_url":"https://github.com/kach/nearley","commit_stats":{"total_commits":934,"total_committers":57,"mean_commits":"16.385964912280702","dds":"0.48394004282655245","last_synced_commit":"6e24450f2b19b5b71557adf72ccd580f4e452b09"},"previous_names":["hardmath123/nearley"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kach%2Fnearley","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kach%2Fnearley/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kach%2Fnearley/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kach%2Fnearley/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kach","download_url":"https://codeload.github.com/kach/nearley/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254168830,"owners_count":22026206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["earley-algorithm","earley-parser","javascript","nearley","node","nodejs","parser","parsing","parsing-library"],"created_at":"2024-07-31T08:00:56.972Z","updated_at":"2025-12-23T01:05:08.763Z","avatar_url":"https://github.com/kach.png","language":"JavaScript","funding_links":[],"categories":["Packages","包","Repository","JavaScript"],"sub_categories":["Parsing","解析","AST"],"readme":"# [nearley](http://nearley.js.org) ↗️\n[![JS.ORG](https://img.shields.io/badge/js.org-nearley-ffb400.svg?style=flat-square)](http://js.org)\n[![npm version](https://badge.fury.io/js/nearley.svg)](https://badge.fury.io/js/nearley)\n\nnearley is a simple, fast and powerful parsing toolkit. It consists of:\n1. [A powerful, modular DSL for describing\n   languages](https://nearley.js.org/docs/grammar)\n2. [An efficient, lightweight Earley\n   parser](https://nearley.js.org/docs/parser)\n3. [Loads of tools, editor plug-ins, and other\n   goodies!](https://nearley.js.org/docs/tooling)\n\nnearley is a **streaming** parser with support for catching **errors**\ngracefully and providing _all_ parsings for **ambiguous** grammars. It is\ncompatible with a variety of **lexers** (we recommend\n[moo](http://github.com/tjvr/moo)). It comes with tools for creating **tests**,\n**railroad diagrams** and **fuzzers** from your grammars, and has support for a\nvariety of editors and platforms. It works in both node and the browser.\n\nUnlike most other parser generators, nearley can handle *any* grammar you can\ndefine in BNF (and more!). In particular, while most existing JS parsers such\nas PEGjs and Jison choke on certain grammars (e.g. [left recursive\nones](http://en.wikipedia.org/wiki/Left_recursion)), nearley handles them\neasily and efficiently by using the [Earley parsing\nalgorithm](https://en.wikipedia.org/wiki/Earley_parser).\n\nnearley is used by a wide variety of projects:\n\n- [artificial\n  intelligence](https://github.com/ChalmersGU-AI-course/shrdlite-course-project)\n  and\n- [computational\n  linguistics](https://wiki.eecs.yorku.ca/course_archive/2014-15/W/6339/useful_handouts)\n  classes at universities;\n- [file format parsers](https://github.com/raymond-h/node-dmi);\n- [data-driven markup languages](https://github.com/idyll-lang/idyll-compiler);\n- [compilers for real-world programming\n  languages](https://github.com/sizigi/lp5562);\n- and nearley itself! The nearley compiler is bootstrapped.\n\nnearley is an npm [staff\npick](https://www.npmjs.com/package/npm-collection-staff-picks).\n\n## Documentation\n\nPlease visit our website https://nearley.js.org to get started! You will find a\ntutorial, detailed reference documents, and links to several real-world\nexamples to get inspired.\n\n## Contributing\n\nPlease read [this document](.github/CONTRIBUTING.md) *before* working on\nnearley. If you are interested in contributing but unsure where to start, take\na look at the issues labeled \"up for grabs\" on the issue tracker, or message a\nmaintainer (@kach or @tjvr on Github).\n\nnearley is MIT licensed.\n\nA big thanks to Nathan Dinsmore for teaching me how to Earley, Aria Stewart for\nhelping structure nearley into a mature module, and Robin Windels for\nbootstrapping the grammar. Additionally, Jacob Edelman wrote an experimental\nJavaScript parser with nearley and contributed ideas for EBNF support. Joshua\nT. Corbin refactored the compiler to be much, much prettier. Bojidar Marinov\nimplemented postprocessors-in-other-languages. Shachar Itzhaky fixed a subtle\nbug with nullables.\n\n## Citing nearley\n\nIf you are citing nearley in academic work, please use the following BibTeX\nentry.\n\n```bibtex\n@misc{nearley,\n    author = \"Kartik Chandra and Tim Radvan\",\n    title  = \"{nearley}: a parsing toolkit for {JavaScript}\",\n    year   = {2014},\n    doi    = {10.5281/zenodo.3897993},\n    url    = {https://github.com/kach/nearley}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkach%2Fnearley","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkach%2Fnearley","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkach%2Fnearley/lists"}