EdgeJS Parser is a specialized JavaScript library designed for parsing HTML and EdgeJS templating syntax, returning an Abstract Syntax Tree (AST). Currently at version 0.2.19, it is built upon the Chevrotain parsing toolkit. Its development is specifically tailored towards the creation of a Prettier plugin for EdgeJS templates, which implies it may not encompass all potential parsing needs or edge cases outside of that particular use-case. As a 0.x.x release, the API may still be subject to changes before a stable 1.0 version. While a formal release cadence isn't specified, updates are likely driven by the needs of its primary Prettier integration.
npm install edgejs-parserVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to install `edgejs-parser` and use its default export to parse a simple EdgeJS template into an Abstract Syntax Tree (AST), including basic error handling for malformed input.
Evaluate if the library's specific scope aligns with your project's parsing needs. For broader or more general parsing, consider alternative, more comprehensive HTML/templating parsers.
Always consult the latest documentation and changelog when upgrading 0.x versions. Be prepared to adapt your code to API changes, especially when interacting directly with the AST.
Avoid making assumptions about the exact AST shape. Implement robust error handling for unexpected structures or use the library as intended for its specific Prettier plugin use case, where the AST is an internal concern.
Update your module to use ES module syntax: `import edgeParser from 'edgejs-parser';`. Ensure your project's `package.json` specifies `"type": "module"` or that your file uses a `.mjs` extension for ESM context.
Review the input template for syntax errors at the indicated position (X). Ensure the template adheres strictly to EdgeJS and HTML parsing rules expected by the library.
No dependency data recorded yet.