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-recipe

v0.3.1

Published

Pharmacological recipe notation

Downloads

772

Readme

tree-sitter-recipe

NPM JSR

Tree-sitter grammar for .recipe files — a digital notation for pharmacological prescriptions in the Dutch/Latin KNMP/FNA tradition.

What it parses

Three section markers (case-insensitive):

| Marker | Meaning | Content | | ------ | ----------- | ------------------------------------ | | R/ | recipe | active ingredient(s), form, strength | | Da/ | da/dispense | quantity to dispense | | S/ | signa | directions to the patient |

Plus Latin abbreviations, modern frequencies (1 dd, 3 dd), numbers with Dutch (0,1) or international (0.1) decimals, and a four-tier comment system.

Example

/**
 * Patient: 45yo female, chronic URTI
 * Allergies: none known
 */
R/ claritromycin tablet 500mg
Da/ 14 tablets
S/ b.d.d. 1 tablet p.c.

#! empirical coverage for suspected CAP
R/ amoxicilline 500mg
Da/ 21 caps
S/ 3 dd 1 caps

# pharmacist: check interaction table before dispensing

Install

bun install        # or: npm install
bun test           # or: npm test

Development

npx tree-sitter generate                   # regenerate parser after grammar changes
npx tree-sitter test                       # run corpus tests
npx tree-sitter parse file.recipe          # inspect parse tree
npx tree-sitter highlight file.recipe      # visualize syntax highlighting
npx tree-sitter build --wasm               # build WASM for playground

Comment system

| Syntax | Purpose | AST role | | ---------- | ----------------- | -------------------- | | # … | line comment | extra (no structure) | | #! … | doc line comment | extra (sibling node) | | /* … */ | block comment | extra (no structure) | | /** … */ | doc block comment | extra (sibling node) |

All four live in extras, so they parse anywhere without affecting structure. Doc variants (#!, /**) are intended for tooling (LSP, formatter, docgen) to associate them with the next section by source position.

Supported abbreviations

Frequency: d.d., b.d.d., t.d.d., q.i.d., s.d.d. plus modern N dd

Dutch prose frequency: 3 keer per dag, driemaal daags, om de 8 uur (structured into count/every/period fields)

Timing: a.c., p.c., a.n., m. et v.

Route: i.m., i.v., s.c., subling., o.d., o.s., a.u.e., u.e.

Compounding: ad (fill-to), dtd / d.t.d. (dispense-this-dose)

Dispensing/warning: d.s.p., u.c., z.n., d.c.p., d.s. monit., d.c. prohib., d.i.m.m., CITO, PIM

Forms: aq. pur., collut., lin., supp., gtt aur., gtt nas., gtt ophth.

Conditional: si nec. sit

Not yet supported

  • International abbreviations (Rx, Rp, sig., prn, qd, qid, bid, tid, hs, stat) — reserved for #!dialect international pragma.
  • iter N x repeat directive — dropped due to lexical conflict with x appearing in signa phrases (2 x daags).
  • ISMP error-prone-abbreviation linting — future tooling, not a grammar concern.
  • Nested language injection inside doc comments — reserved for a later release.

License

MIT © Kaj Kowalski