Peggy/PEG.js Utility Library

JSON →
library 2.0.2 ·javascript
verified May 27, 2026

pegjs-util is a utility library for the Peggy parser generator (formerly PEG.js), currently at stable version 2.0.2. It enhances Peggy's core `parse` function by injecting convenient utilities directly into grammar actions. The library provides three main features: Parser Tree Token Unrolling, which simplifies common patterns of extracting tokens from repeated grammar rule matches; Abstract Syntax Tree (AST) Node Generation, which assists in building structured ASTs directly within grammar rules; and improved, "cooked" Error Reporting, offering more user-friendly diagnostics than Peggy's default output. Releases appear to follow the development of Peggy itself, with the latest versions published as needed. It differentiates itself by streamlining common parser generator tasks, reducing boilerplate in `.peggy` grammar files, and providing a more robust parsing and error reporting experience.

total hits 16
actors 6 distinct systems
last hit 2d ago AhrefsBot
GPTBot
2
Script
1
ClaudeBot
1
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇫🇷 France · 🇨🇦 Canada · 🇳🇴 Norway · 🇩🇪 Germany