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

@drug-database/sdk

v0.1.0

Published

Official Drug Database JS/TS SDK — Swiss drug master, ATC, interactions, change feed.

Downloads

158

Readme

@drug-database/sdk

Official JS/TS SDK for the Drug Database — a worldwide drug master + interactions API covering Switzerland, the European Union, and the United States (28 public sources). Typed methods for drug search, ATC lookup, interaction checks, change feed, and PHI-Gateway-routed prescription validation.

Install

npm i @drug-database/sdk

(Marketing snippet — same as on the docs page.)

Requires Node 18+ or any modern runtime with a global fetch (browsers, Deno, Bun, Cloudflare Workers, edge runtimes). Zero runtime dependencies.

Quickstart

import { DrugDatabase } from '@drug-database/sdk'

const ms = new DrugDatabase({ apiKey: 'ms_live_...' })

// Search any jurisdiction: CH / GB / FR / DE / IT / AT / ES / DK / SE / FI /
// NO / NL / BE / IE / PT / US.
const results = await ms.drugs.search({ q: 'Ibuprofen', country: 'DE', limit: 5 })

const interactions = await ms.interactions.check({
  drugs: [{ atc_code: 'M01AE01' }, { atc_code: 'N02BE01' }],
})

Configuration

new DrugDatabase({
  apiKey: 'ms_live_...',
  baseUrl: 'https://drug-database.com', // override for self-hosted enterprise tenants
  timeoutMs: 30_000,
  phiGatewayApiKey: 'phi_live_...',     // required when patient context is used
})

baseUrl also falls back to the DRUG_DATABASE_API_BASE env var if set.

API surface

All methods return typed payloads matching /v1/...:

ms.drugs.search({ q, country, atc, limit, cursor })
ms.drugs.get(id)
// Any identifier system: gtin, pharmacode, cip13, pzn, ndc11, rxcui, unii, dmd_amppid, …
ms.drugs.lookup({ system: 'ndc11', code: '00071015523' })
ms.drugs.monograph(id, 'de')
for await (const batch of ms.drugs.dump({ format: 'jsonl' })) { /* RAG ingest */ }

ms.atc.get('N02BE01')
ms.atc.children('N02BE')
ms.atc.drugs('N02BE01')

ms.interactions.check({ drugs: [{ atc_code: 'M01AE01' }, { atc_code: 'N02BE01' }] })

ms.changes.list({ since: '2026-01-01T00:00:00Z' })
for await (const change of ms.changes.subscribe({ intervalMs: 60_000 })) { /* webhook-like */ }

ms.prescriptions.validate({
  patient: { age_band: '65-74', egfr_band: '30-59', conditions: ['I10'] },
  current_medications: [{ atc_code: 'C09AA02' }],
  proposed_drug: { atc_code: 'M01AE01', dose: '400mg', frequency: 'tid' },
})

PHI handling

prescriptions.validate is the only PHI-touching method. The SDK refuses to send patient context without a phiGatewayApiKey. Patient context is bucketed (age band, eGFR band, condition codes) — never names, DOBs or MRNs. See drug-database.com/phi.

License

MIT