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

pwa-jsonld

v1.0.0

Published

Typed JSON-LD generator for PWA/WebApplication rich snippets; you render the string into <head>.

Readme

pwa-jsonld

JSON-LD generator for Schema.org WebApplication rich snippets. Zero dependencies, typed, and PWA-first. You get the string; you must place it in <head> yourself.

What this does

  • Generates minified WebApplication JSON-LD from one typed function.
  • Leaves rendering to you: wrap the string in <script type="application/ld+json">...</script> inside <head>.
  • SaaS-aware optional offers (Free/Trial/Subscription/OneTime) and rating fields.
  • ESM + TypeScript types, tree-shakeable, no runtime deps.

Install

npm install pwa-jsonld
# or
yarn add pwa-jsonld
pnpm add pwa-jsonld

How to use (2 steps)

  1. Generate JSON-LD with the function:
import { webAppJsonLd } from "pwa-jsonld";

const ld = webAppJsonLd({
  appName: "Arcade Mail",
  appUrl: "https://mail.arcade.app",
  pageUrl: "https://mail.arcade.app/features",
  description: "Fast, offline-capable email for teams. Built as a PWA.",
  publisherName: "Arcade Labs",
  publisherUrl: "https://arcade.app",
  applicationCategory: "CommunicationApplication",
  operatingSystem: "All",
  browserRequirements: "Requires Service Worker",
  imageUrl: "https://mail.arcade.app/og.png",
  logoUrl: "https://mail.arcade.app/logo.svg",
  featureList: ["Offline sync", "Push notifications", "Multi-account"],
  keywords: ["email", "pwa", "offline"],
  sameAs: ["https://twitter.com/arcade", "https://github.com/arcade"],
  rating: { ratingValue: 4.8, ratingCount: 1240 },
  offers: [
    { kind: "Free", name: "Free", url: "https://mail.arcade.app/signup" },
    {
      kind: "Subscription",
      name: "Pro",
      url: "https://mail.arcade.app/pricing",
      price: 12,
      priceCurrency: "USD",
      billingPeriod: "P1M",
    },
  ],
  supportUrl: "https://help.arcade.app",
});
  1. Inject it into <head> yourself (plain HTML example):
<script type="application/ld+json">// result here</script>

Framework notes:

  • React/Next: <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: ld }} />
  • Astro/Svelte/Solid: wrap ld inside a raw <script type="application/ld+json"> block.

API

  • webAppJsonLd(input: WebAppRichDataInput): string — builds minified JSON-LD for WebApplication with null-stripping. You are responsible for placing it inside <head>.
  • pwaJsonLd is an alias for the same function.

Input reference (WebAppRichDataInput)

Required

  • appName: App display name.
  • appUrl: Canonical root for the app.
  • description: Human-friendly summary.
  • publisherName: Organization behind the app.
  • publisherUrl: Canonical organization URL.
  • applicationCategory: One of the curated categories (e.g. ProductivityApplication, CommunicationApplication).

Recommended

  • pageUrl: Canonical page being described (mainEntityOfPage).
  • imageUrl: Representative image.
  • logoUrl: Brand logo for the publisher.
  • operatingSystem: Defaults to All.
  • browserRequirements: Defaults to Requires JavaScript; set to Requires Service Worker for PWAs.
  • featureList: Short bullet strings of key features.
  • keywords: Short, comma-ready keywords.
  • sameAs: Authority/social profile URLs.
  • supportUrl: Help/contact URL.

Ratings (only if public and real)

  • rating: { ratingValue: number; ratingCount: number; }

Offers (SaaS-friendly)

  • offers: Array of one of:
    • { kind: "Free"; name; url; availability? }
    • { kind: "Trial"; name; url; trialLengthDays; availability? }
    • { kind: "Subscription"; name; url; price; priceCurrency; billingPeriod; availability? }
    • { kind: "OneTime"; name; url; price; priceCurrency; availability? }

Validation

  • Paste the JSON-LD into Google Rich Results Test or Schema Markup Validator.
  • Verify appUrl, publisherUrl, and supportUrl are canonical (https, no redirects).
  • Only publish ratings/pricing that match public pages to avoid penalties.

Notes

  • This library only generates the JSON-LD string; you must place it inside <head> as <script type="application/ld+json"> using your own templating/framework.
  • Output is minified; format it before pasting into validators if you want readability.

License

MIT