npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tree-sitter-coral

v0.2.7

Published

Tree-sitter grammar for Coral DSL

Readme

tree-sitter-coral

Native Tree-sitter grammar for Coral syntax tooling.

This package compiles from source during installation; it doesn't ship prebuilt binaries. Python is required on every supported native-build platform. Linux/Unix also needs make and a C/C++ toolchain; macOS needs Xcode Command Line Tools; Windows needs Visual Studio C++ build tools.

Before installing, npm 12 consumers must approve the native lifecycle scripts in the root package.json:

{
  "allowScripts": {
    "tree-sitter-coral": true,
    "tree-sitter": true
  }
}

Then install the exact grammar and peer versions verified for Coral 0.2.7:

npm install [email protected] [email protected]
import Parser from 'tree-sitter';
import Coral from 'tree-sitter-coral';

const parser = new Parser();
parser.setLanguage(Coral);
const tree = parser.parse('service "API" as api');
if (tree.rootNode.hasError) throw new Error(tree.rootNode.toString());

The grammar recognizes the Language 1.0 editor-tooling subset: graph data, nodes and bodies, edges with compact relationship ends, positions/pins, spatial constraints, route intent, and comments. Runtime parsing, reference resolution, semantic diagnostics, canonicalization, and repair remain owned by @coral-viz/language.

Edge attributes accept an optional relation, an optional line style, and then named attributes, with at least one entry. Empty [], [dashed, event], [dashed, dotted], [a, b], and [label: "x", dashed] produce syntax errors. [dashed], [event], ["dashed", dotted], and [dashed: "x"] are valid. The style words solid, dashed, and dotted remain ordinary identifiers outside bare attribute entries.

Compact annotations such as a (1 "owner" diamond+ nav) -> b (0..*) attach to the immediately preceding endpoint. The tree exposes source_end and target_end fields containing relationship_end nodes, whose parts are multiplicity, string, end_marker, and navigability (nav or nonav). Each part occurs at most once, in that order; other orders and repeated parts are syntax errors. A multiplicity bound is plain digits, so 1.0, 1e0, 01, and +1 are syntax errors. Marker fill suffixes must touch the marker name; fixed markers do not accept suffixes. Separate compact parts with spaces or tabs. Multiplicity ranges keep the number, .., and upper bound adjacent: 1..2, not 1 .. 2. An annotation stays on one line: line breaks and comments cannot separate its parentheses or parts. Quoted comment text and escaped newline text remain roles.

Quoted references are accepted on both sides of an edge, with or without a compact end, such as "q r" ("s") -> b.

This is syntax recognition, not complete runtime conformance. Repeated JSON keys are recognized for runtime duplicate diagnostics. The runtime also owns E1–E13 end validation, equal bounds written as a range (1..1), bounds above 9007199254740991, empty roles, reference resolution, and whether JSON end contents require a compact spelling.

For repository testing, build @coral-viz/language and this package first. npm run test:run -w tree-sitter-coral runs the syntax corpus and native/runtime compact-boundary parity tests.

See the published Tree-sitter reference.

Apache-2.0. See LICENSE.