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

@zenuinebit/prescription

v0.1.0

Published

Prescription dosing helpers: frequency to times, course length, quantity to dispense, weight-based dose and a printable text/HTML format.

Readme

@zenuinebit/prescription

Helpers for writing prescriptions: dosing frequency, quantity to dispense, dose by body weight, and a printable layout. No dependencies.

These helpers do arithmetic and formatting only. They know no drug, check no interactions and do not decide whether a dose is safe. A qualified clinician must review every prescription and dose.

import {
  parseFrequency, describeFrequency, quantity, courseEnd, administrationTimes,
  weightBasedDose, liquidVolumeMl, renderText, renderHTML,
} from "@zenuinebit/prescription";

describeFrequency("1-0-1");                       // "1-0-1 (morning, night)"
quantity({ frequency: "TDS", days: 5 });          // { units: 15, dispense: 15 }
quantity({ frequency: "OD", days: 5, unitsPerTake: 0.5, packSize: 10 }); // { units: 2.5, dispense: 3, packs: 1 }
courseEnd("2025-03-01", 5);                       // "2025-03-05"
administrationTimes("TDS");                       // ["08:00", "15:00", "22:00"]

// Weight-based: say whether the figure is per dose or per day, there is no default
weightBasedDose({ weightKg: 12, mgPerKg: 15, basis: "per-dose", dosesPerDay: 3, maxSingleMg: 500 });
// { singleMg: 180, dailyMg: 540, capped: false }
liquidVolumeMl(180, { mg: 125, ml: 5 });          // 7.2 (ml)

renderText(rx);    // plain text for chat or a thermal printer
renderHTML(rx);    // A5 page to print; all text is escaped

Frequencies understood: OD, BD, TDS, QID, HS, STAT, SOS/PRN, Q4H/Q6H/Q8H/Q12H (dots and case ignored), and morning-afternoon-night notation like 1-0-1 or 1-1-1-1. In that notation each number is a multiplier of unitsPerTake.

Good to know

  • SOS/PRN medicines need maxPerDay before a quantity can be worked out.
  • Maximums in weightBasedDose lower the dose and set capped: true. Rounding never pushes a dose back over its maximum.
  • courseEnd counts the start day as day 1.

Not included: a drug database, interaction or allergy checks, renal or paediatric dosing rules, and digital signatures.