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

pillfyi-embed

v1.1.0

Published

Embed PillFYI widgets — FDA drug cards, dosage forms, drug interactions. 4,934 drugs. Zero dependencies, Shadow DOM, 4 themes. Medical disclaimer included.

Readme

pillfyi-embed

npm TypeScript License: MIT Zero Dependencies

Embed PillFYI widgets — drugs, glossary terms, interactive tools, and inline elements — on any website. 7 widget types, zero dependencies, Shadow DOM style isolation, 4 built-in themes (light, dark, sepia, auto), 2 styles (modern, clean), and live data from the PillFYI database.

Every widget includes a "Powered by PillFYI" backlink and a medical disclaimer directing readers to consult healthcare professionals.

Try the interactive widget builder at widget.pillfyi.com

⚕️ Medical Disclaimer: All Health FYI widgets include an educational disclaimer. This information is for educational purposes only and should not replace professional medical advice.

Quick Start

<!-- Place widget div where you want it to appear -->
<div data-pillfyi="entity" data-slug="drugs" data-theme="light"></div>

<!-- Load the embed script once, anywhere on the page -->
<script src="https://cdn.jsdelivr.net/npm/pillfyi-embed@1/dist/embed.min.js"></script>

That's it. The widget fetches data from the PillFYI API and renders with full style isolation.

Widget Types

| Type | Usage | Description | |------|-------|-------------| | entity | <div data-pillfyi="entity" data-slug="..."></div> | Entity detail card | | glossary | <div data-pillfyi="glossary" data-slug="..."></div> | Glossary term definition | | guide | <div data-pillfyi="guide" data-slug="..."></div> | Guide summary card | | search | <div data-pillfyi="search" data-slug="..."></div> | Search box | | compare | <div data-pillfyi="compare" data-slug="..."></div> | Side-by-side comparison | | faq | <div data-pillfyi="faq" data-slug="..."></div> | FAQ accordion | | dosage-badge | <div data-pillfyi="dosage-badge" data-slug="..."></div> | Inline dosage form badge |

Widget Options

| Attribute | Values | Default | Description | |-----------|--------|---------|-------------| | data-pillfyi | entity, compare, glossary, guide, search, faq, [tools] | required | Widget type | | data-slug | e.g. "drugs" | — | Entity slug from the PillFYI database | | data-theme | light, dark, sepia, auto | light | Visual theme (auto follows OS preference) | | data-style-variant | modern, clean | modern | Widget design style | | data-size | default, compact, large | default | Widget size | | data-placeholder | any string | "Search Drugs..." | Search box placeholder |

Themes

<!-- Light (default) -->
<div data-pillfyi="entity" data-slug="drugs" data-theme="light"></div>

<!-- Dark -->
<div data-pillfyi="entity" data-slug="drugs" data-theme="dark"></div>

<!-- Sepia -->
<div data-pillfyi="entity" data-slug="drugs" data-theme="sepia"></div>

<!-- Auto — follows OS dark/light preference -->
<div data-pillfyi="entity" data-slug="drugs" data-theme="auto"></div>

Styles

<!-- Modern (default) — clean lines, rounded corners, accent gradients -->
<div data-pillfyi="entity" data-slug="drugs" data-style-variant="modern"></div>

<!-- Clean — minimal borders, utility-focused, data-first aesthetic -->
<div data-pillfyi="entity" data-slug="drugs" data-style-variant="clean"></div>

Web Components (Custom Elements)

As an alternative to data-* attributes, you can use native HTML custom elements:

<!-- Custom element form -->
<pillfyi-entity slug="drugs" theme="light"></pillfyi-entity>
<pillfyi-compare slugs="drugs,other-slug"></pillfyi-compare>
<pillfyi-search placeholder="Search Drugs..."></pillfyi-search>

<script src="https://cdn.jsdelivr.net/npm/pillfyi-embed@1/dist/embed.min.js"></script>

Use style-variant (not style) to avoid conflicts with the HTML reserved style attribute.

CDN Options

jsDelivr (recommended — global CDN, auto-updates with npm)

<script src="https://cdn.jsdelivr.net/npm/pillfyi-embed@1/dist/embed.min.js"></script>

Specific version (production stability)

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/embed.min.js"></script>

npm (for bundlers)

npm install pillfyi-embed
import 'pillfyi-embed';

Technical Details

  • Shadow DOM: Complete style isolation — no CSS conflicts with your site
  • Zero dependencies: No jQuery, React, or any external library
  • 2 styles: Modern (accent gradients) and Clean (minimal, data-first)
  • 4 themes: Light, Dark, Sepia, Auto (OS preference detection)
  • CORS: PillFYI API has CORS enabled for all origins
  • MutationObserver: Works with dynamically added elements (SPAs)
  • IntersectionObserver: Lazy loading — widgets only fetch when entering viewport (200px margin)
  • Rich Snippets: DefinedTerm JSON-LD injected for glossary widgets
  • Medical Disclaimer: All widgets include an educational disclaimer footer
  • Bundle size: Tree-shaken per site — only includes tools available on PillFYI

Learn More

Visit pillfyi.com — PillFYI is a comprehensive drugs reference with interactive tools, guides, and developer resources.

Health FYI Family

Part of FYIPedia — open-source developer tools ecosystem. Health FYI covers anatomy, drugs, pharmacology, and nutrition. Hub: bodyfyi.com.

| Site | Domain | Focus | Package | |------|--------|-------|---------| | AnatomyFYI | anatomyfyi.com | 14,692 anatomical structures, body systems, regions | npm | | PillFYI | pillfyi.com | 4,934 FDA drugs, interactions, side effects | npm | | DrugFYI | drugfyi.com | 4,009 drugs, molecular formulas, pharmacology | npm | | NutriFYI | nutrifyi.com | 15,236 foods, USDA nutrition data, 12 diets | npm |

FYIPedia Developer Tools

| Package | PyPI | npm | Description | |---------|------|-----|-------------| | colorfyi | PyPI | npm | Color conversion, WCAG contrast, harmonies — colorfyi.com | | emojifyi | PyPI | npm | Emoji encoding & metadata for 3,953 emojis — emojifyi.com | | unitfyi | PyPI | npm | Unit conversion, 220 units — unitfyi.com | | timefyi | PyPI | npm | Timezone ops & business hours — timefyi.com | | holidayfyi | PyPI | npm | Holiday dates & Easter calculation — holidayfyi.com | | fyipedia | PyPI | — | Unified CLI for all FYI tools — fyipedia.com |

License

MIT — see LICENSE.

Built with care by FYIPedia.