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

docmint

v0.1.0

Published

Generate beautiful branded business PDFs from structured data.

Readme


What is Docmint?

Docmint is a modular document engine for generating beautiful, branded business PDFs from structured data.

Instead of manually building PDFs from scratch, Docmint gives you a clean TypeScript API for creating professional documents like:

  • Offers and proposals
  • Invoices
  • Reports and audits
  • Custom branded documents
  • API-generated PDFs
  • HTML previews before PDF export

Docmint is built around a simple idea:

Your data goes in. A polished branded PDF comes out.


Install

npm install docmint

or

pnpm add docmint

or

yarn add docmint

Quick Start

import { createOfferPdf, oavaBrand } from "docmint";

await createOfferPdf({
  output: "./offer.pdf",
  brand: oavaBrand,
  customer: {
    name: "Herr Müller",
    company: "Müller Dachtechnik GmbH",
    email: "[email protected]"
  },
  document: {
    title: "Neue digitale Präsenz",
    number: "ANG-2026-001",
    date: "2026-07-08",
    validUntil: "2026-07-22"
  },
  offer: {
    intro:
      "Eine moderne Website, gebaut für Vertrauen, Sichtbarkeit und mehr Kundenanfragen.",
    items: [
      {
        name: "Website Design & Entwicklung",
        description:
          "Moderne Unternehmenswebsite inklusive responsivem Design, Kontaktbereich und conversion-orientierter Struktur.",
        quantity: 1,
        price: 980,
        type: "one_time"
      },
      {
        name: "Hosting, Wartung & SEO Updates",
        description:
          "Hosting, SSL, Updates, Backups und grundlegende SEO Betreuung.",
        quantity: 1,
        price: 49,
        type: "monthly"
      }
    ],
    notes: [
      "50 Prozent Anzahlung, Restzahlung erst bei vollständiger Zufriedenheit.",
      "Kostenlose und unverbindliche Demo Vorschau enthalten.",
      "14 Tage Geld-zurück-Garantie bei Unzufriedenheit."
    ]
  }
});

Why Docmint?

Most PDF libraries give you low-level primitives.

Docmint gives you a real document system.

createOfferPdf()
createInvoicePdf()
createReportPdf()
createDocumentPdf()
createDocumentHtml()
defineTemplate()
defineBlock()
defineBrand()

It is designed for developers who want beautiful PDFs without rebuilding layout, branding, tables, pricing summaries, and document structure every time.


Features

Core

  • TypeScript-first API
  • HTML to PDF rendering
  • Branded document generation
  • Reusable document blocks
  • Custom templates
  • Custom brands and themes
  • HTML preview generation
  • Offer, invoice, and report templates
  • Server/API-ready architecture
  • Clean output for business documents

Built-in Document Types

  • Offers
  • Invoices
  • Reports
  • Custom documents

Built-in Blocks

  • Hero sections
  • Pricing tables
  • Line item tables
  • Notes
  • Key-value sections
  • Summary cards
  • Signature sections
  • Footers
  • Page breaks
  • Spacers

Create an Invoice

import { createInvoicePdf, defaultBrand } from "docmint";

await createInvoicePdf({
  output: "./invoice.pdf",
  brand: defaultBrand,
  customer: {
    name: "Herr Müller",
    company: "Müller Dachtechnik GmbH",
    email: "[email protected]",
    address: "Musterstraße 12, 12345 Berlin"
  },
  document: {
    title: "Invoice",
    number: "INV-2026-0042",
    date: "2026-07-08",
    dueDate: "2026-08-08"
  },
  invoice: {
    items: [
      {
        name: "Strategic Website Consulting",
        description: "Audit, concept and roadmap for the website relaunch.",
        quantity: 12,
        price: 150,
        type: "one_time"
      },
      {
        name: "Managed Hosting & Support",
        description: "Premium hosting, backups and priority support.",
        quantity: 1,
        price: 99,
        type: "monthly"
      }
    ],
    tax: {
      rate: 0.19,
      label: "VAT (19%)"
    },
    payment: {
      recipient: "Docmint GmbH",
      iban: "DE89 3704 0044 0532 0130 00",
      bic: "COBADEFFXXX",
      bank: "Commerzbank",
      reference: "INV-2026-0042"
    },
    notes: ["Payment due within 30 days.", "Thank you for your business."]
  }
});

Create a Report

import { createReportPdf, defaultBrand } from "docmint";

await createReportPdf({
  output: "./report.pdf",
  brand: defaultBrand,
  document: {
    title: "Website Audit Report",
    subtitle: "SEO & Performance Analysis",
    number: "RPT-2026-014",
    date: "2026-07-08"
  },
  report: {
    sections: [
      {
        heading: "Executive Summary",
        content:
          "The website has a solid technical foundation, but several content and performance gaps limit organic reach."
      },
      {
        heading: "Key Findings",
        content: "Critical issues discovered during the audit:",
        bullets: [
          "Meta descriptions missing on high-traffic pages",
          "Images are not served in next-gen formats",
          "Core Web Vitals need improvement on mobile",
          "No structured data for local business markup"
        ]
      }
    ]
  }
});

HTML Preview

Generate HTML before exporting to PDF.

import { createOfferHtml } from "docmint";

const html = createOfferHtml({
  brand: "default",
  customer: {
    name: "Herr Müller",
    company: "Müller Dachtechnik GmbH"
  },
  document: {
    title: "Neue digitale Präsenz",
    number: "ANG-2026-001",
    date: "2026-07-08"
  },
  offer: {
    items: []
  }
});

console.log(html);

This is useful for:

  • Debugging layouts
  • Building preview screens
  • Rendering previews inside dashboards
  • Testing templates before exporting PDFs

Modular Document Engine

Docmint is not just a PDF generator.

It is built as a modular document engine.

import {
  createDocumentPdf,
  defineTemplate,
  heroBlock,
  pricingTableBlock,
  notesBlock,
  signatureBlock,
  defaultBrand
} from "docmint";

const proposalTemplate = defineTemplate({
  name: "custom-proposal",
  render(ctx) {
    return [
      heroBlock({
        eyebrow: "Proposal",
        title: ctx.document.title,
        subtitle: ctx.document.subtitle
      }),
      pricingTableBlock({
        items: ctx.document.items
      }),
      notesBlock({
        notes: ctx.document.notes
      }),
      signatureBlock({
        label: "Accepted by"
      })
    ];
  }
});

await createDocumentPdf({
  output: "./proposal.pdf",
  brand: defaultBrand,
  template: proposalTemplate,
  document: {
    title: "Custom Proposal",
    subtitle: "Generated with Docmint",
    items: [],
    notes: []
  }
});

Custom Brands

import { defineBrand } from "docmint";

export const acmeBrand = defineBrand({
  name: "Acme Solutions",
  primary: "#4F46E5",
  accent: "#06B6D4",
  background: "#0F172A",
  surface: "#111827",
  surfaceLight: "rgba(255,255,255,0.06)",
  text: "#F8FAFC",
  muted: "#94A3B8",
  border: "rgba(255,255,255,0.12)",
  fontFamily: "Inter, Arial, sans-serif"
});

Use it like this:

await createOfferPdf({
  brand: acmeBrand,
  output: "./offer.pdf",
  customer,
  document,
  offer
});

Custom Blocks

import { defineBlock, escapeHtml } from "docmint";

export const warningBlock = defineBlock({
  name: "warning",
  render({ title, message }) {
    return `
      <section class="dm-card dm-warning">
        <h2>${escapeHtml(title)}</h2>
        <p>${escapeHtml(message)}</p>
      </section>
    `;
  }
});

Blocks make it easy to build your own document system on top of Docmint.


API Server

Docmint can also be used as an API-ready PDF generation service.

npx docmint serve

Start on a custom port:

npx docmint serve --port 3000

With API key authentication:

npx docmint serve --api-key your-secret-key

Generate a PDF over HTTP:

curl -X POST http://localhost:3000/v1/pdf/offer \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-secret-key" \
  -d @examples/api-offer.json \
  --output offer.pdf

CLI

npx docmint serve

Example output:

Docmint API server running on http://localhost:3000
Health: http://localhost:3000/health
Templates: http://localhost:3000/v1/templates

Example Output

Docmint can generate documents like:

  • Premium offers
  • Clean invoices
  • Modern reports
  • Branded custom documents
  • API-generated PDFs
  • HTML previews

The goal is simple:

Make generated business documents look designed, not exported.


Project Structure

src/
  core/
    create-document.ts
    define-template.ts
    define-block.ts
    define-brand.ts
    registry.ts

  renderers/
    html-to-pdf.ts

  blocks/
    hero.ts
    table.ts
    pricing-table.ts
    notes.ts
    footer.ts
    signature.ts

  templates/
    offer.ts
    invoice.ts
    report.ts
    base-layout.ts

  brands/
    default.ts
    oava.ts

  server/
    create-server.ts
    routes.ts
    auth.ts
    config.ts

  utils/
    money.ts
    date.ts
    escape-html.ts
    totals.ts

Development

Clone the repository:

git clone https://github.com/OAVA-Studios/docmint.git
cd docmint

Install dependencies:

npm install

Run typecheck:

npm run typecheck

Build:

npm run build

Generate examples:

npm run examples

Run the API server:

npm run start:server

Roadmap

Docmint is currently focused on the core open-source document engine.

Planned future ideas:

  • More templates
  • More built-in blocks
  • Better visual template presets
  • PDF signing workflows
  • Watermarks
  • QR code blocks
  • S3-compatible storage adapters
  • Hosted document API
  • Web UI template builder
  • Pay-as-you-go hosted Docmint Cloud

Author

Built by Darko Mitru.


License

MIT