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

nlpp-grammar

v1.0.1

Published

Parser for the Natural Language++ pseudo-code spec for AI agents

Downloads

307

Readme

nlpp-grammar

Tree-sitter grammar for NL++ — a pseudocode language for expressing software architecture and implementation intent to AI coding agents.

NL++ files use the .nlpp extension and language ID nlpp. The language lets you sketch structure, dependencies, and intent in a form that is both human-readable and toolable: syntax highlighting, autocomplete, import inlining, and symbol resolution, all feeding into a structured prompt ready for a coding agent.


Quick example

service OrderService {
    uses PaymentGateway

    method auto place_order(Order order) {
        uses PaymentGateway.charge
        /?
          Must be idempotent. Kick off fulfilment on success.
        ?/
    }

    ???
}

For the full language reference see nlpp-spec-v1.0.md.


What this repo contains

| Path | Purpose | |---|---| | grammar.js | Tree-sitter grammar definition | | src/ | Generated C parser (output of tree-sitter generate) | | queries/highlights.scm | Syntax highlighting capture groups (tree-sitter) | | nlpp.tmLanguage.json | TextMate grammar — highlighting for editors/tools that don't run tree-sitter | | bindings/node/ | Node entry point — locates the WASM and queries (no parsing, no dependencies) | | tree-sitter-nlpp.wasm | Compiled grammar; the artifact JS consumers actually load | | test/ | Corpus tests (tree-sitter test) | | nlpp-spec-v1.0.md | Full NL++ language specification | | CONTRIBUTING.md | Build system details, local install, and release workflow |


Building

Requires the tree-sitter CLI.

npm install
tree-sitter generate     # regenerate src/ from grammar.js
tree-sitter build --wasm # compile the WASM grammar

npm run build runs generate + build in one step.


Testing

tree-sitter test       # corpus tests in test/corpus/
npm test               # Node.js binding tests

Syntax highlighting

Capture groups defined in queries/highlights.scm:

| Capture | Tokens | |---|---| | @comment.line | // line comments | | @comment.block | /* */ block comments | | @keyword | define, uses, field, inherits, implements, custom block keywords | | @keyword.import | import | | @keyword.function | function, method, getter, setter | | @keyword.type | object keywords (layer, module, service, component, class, interface, enum, type), auto | | @keyword.modifier | public, private, override | | @string | quoted strings ("…") | | @string.special | prose delimiters /? ?/, prose text, ??? fill-in markers, hint text | | @constant | define names | | @type.definition | object and custom block names | | @function | function / method / getter / setter names | | @variable.member | field names | | @type | type annotations (fields, parameters, return types) | | @variable.parameter | parameter names | | @variable | uses targets |

TextMate grammar

nlpp.tmLanguage.json (the nlpp-grammar/textmate export) is a second grammar for NL++, in TextMate/regex form. tree-sitter is precise but not everywhere — this grammar covers the places it can't run:

  • Editors, for highlight-on-open before a tree-sitter language server has started. VS Code registers it via contributes.grammars.
  • The web, via Shiki and other TextMate-based highlighters, which consume it natively — the WASM is no help to them.

Being regex-based it is approximate where the tree-sitter grammar relies on a GLR conflict (the type-vs-name boundary and custom-block keywords); everything lexical, including recursive [ … ] template arguments, it gets exactly right. It is a hand-maintained duplicate of grammar.js, kept honest by a parity test (npm run test:parity) that asserts the two highlighters agree token by token. See CONTRIBUTING.md before editing either grammar.


Contributing / releasing

See CONTRIBUTING.md for local development setup, prebuild instructions, and the npm release workflow.