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

pdf-certificate-kit

v0.1.0

Published

Lightweight, framework-agnostic certificate PDF generator built on pdf-lib. Template + data + signatures -> small vector PDF, in the browser or Node.

Readme

pdf-certificate-kit

Lightweight, framework-agnostic certificate PDF generator built on pdf-lib. You give it an admin-editable template (logo + text with {{variables}} + theme), a flat data bag, and a list of signatures; it returns a small, vector PDF — in the browser or in Node.

Built and consumed exactly like the in-repo czero package: TypeScript + Rollup → dist/index.{js,cjs,d.ts}.

Install

pdf-lib is a peer dependency (consumed from the host app to avoid duplication).

// the host app's package.json
{
  "dependencies": {
    "pdf-certificate-kit": "file:../pdf-certificate-kit", // or a published version range once released
    "pdf-lib": "^1.17.1"
  }
}

Then build the package: npm install && npm run build inside pdf-certificate-kit/.

Usage

import { renderCertificate, downloadBytes } from "pdf-certificate-kit";

const pdfBytes = await renderCertificate({
  template: {
    logo: { data: logoBytesOrDataUrl, maxHeight: 60 },
    eyebrow: "Indian Institute of Technology Indore",
    title: "Certificate of Appointment",
    body:
      "This is to certify that {{name}} ({{rollNumber}}) has been appointed as\n" +
      "{{position}} of {{club}} for the tenure {{tenure}}.",
    theme: { accentColor: "#1360AB", orientation: "landscape" },
  },
  data: {
    name: "Asha Rao",
    rollNumber: "210123",
    position: "General Secretary",
    club: "Robotics Club",
    tenure: "2025–2026",
  },
  signatures: [
    { name: "Dr. A. Mehta", position: "Dean, Student Affairs", image: deanSigBytes },
    { name: "Asha Rao", position: "Student", text: "Asha Rao" },
  ],
});

downloadBytes(pdfBytes, "por-certificate.pdf");

Signature layout

The footer adapts to the number of signatures:

| Count | Layout | | ----- | --------------------------------------- | | 1 | right-aligned | | 2 | left and right | | 3+ | evenly spaced (wraps to rows if needed) |

API

  • renderCertificate(options): Promise<Uint8Array> — core renderer (isomorphic).
  • applyTemplateVariables(text, data): string — substitute {{vars}}.
  • extractTemplateVariables(text): string[] — list {{vars}} referenced (handy for admin UIs).
  • downloadBytes(bytes, filename, mimeType?) — browser download helper.
  • fetchAsBytes(url, init?): Promise<Uint8Array> — fetch an (e.g. signed) image URL as bytes.
  • compressImage(fileOrBlob, options?): Promise<CompressedImage> — downscale/recompress images client-side so signatures (and the PDF) stay tiny.

Output uses only PDF standard fonts (no embedding), so files are small; keep logo/signature images small via compressImage for best results.