Skip to content
Logo

Installation

Aster is ESM only and has no runtime dependencies.

It's also published to JSR.

Requirements

  • Node 20 or later, Bun, or Deno.
  • A JavaScript engine with the regex v flag for toRegExp, which compiles with it. Node 20, current Bun and Deno, and every current browser have it. toPattern returns source text, so it works anywhere, and its patterns mean the same under u.
  • TypeScript is not required, but it is strongly recommended. The AST's types are inferred from your grammar, and rule names are checked where you pass them.

Entry points

  • @ghostry/aster: grammar, the combinators, initialize, AsterError, and the types.
  • @ghostry/aster/unstable-ir: the node types and subexpressions, for tools that read a grammar's structure. Any of it can change in any release. See Grammars as data.