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

pdfmake

v0.3.15

Published

Client/server side PDF printing in pure JavaScript

Readme

pdfmake Node.js CI GitHub npm

PDF document generation library for Node.js and browsers, written in pure JavaScript.

Check out the playground and examples.

Features

  • line wrapping
  • text alignment (left, right, centered, justified)
  • numbered and bulleted lists
  • tables and columns:
    • auto/fixed/star-sized widths
    • column spans and row spans
    • headers automatically repeated after a page break
    • snaking columns (newspaper-style layout where content flows from column to column)
  • images, SVG and vector graphics
  • QR codes
  • convenient styling and style inheritance
  • page headers and footers:
    • static or dynamic content
    • access to current page number and page count
  • background layer
  • watermarks
  • page dimensions and orientations
  • margins
  • document sections
  • custom page breaks
  • font embedding
  • support for complex, multi-level (nested) structures
  • table of contents
  • document outlines (bookmarks)
  • external links and internal navigation
  • file attachments
  • encryption, password protection and document permissions
  • PDF/A support
  • helper methods for opening/printing/downloading the generated PDF
  • PDF metadata (e.g. author, subject)

Installation

Install with npm:

npm install pdfmake

Quick start

Node.js

Save the following as example.js:

const pdfmake = require('pdfmake');
const Roboto = require('pdfmake/fonts/Roboto');

pdfmake.addFonts(Roboto);

const docDefinition = {
	content: ['Hello from pdfmake!']
};

pdfmake.createPdf(docDefinition).write('document.pdf').catch(console.error);

Run node example.js to create document.pdf in the current directory.

Browser

Save the following as index.html next to your node_modules directory and open it in a browser.

<!doctype html>
<meta charset="utf-8">
<script src="node_modules/pdfmake/build/pdfmake.min.js"></script>
<script src="node_modules/pdfmake/build/vfs_fonts.js"></script>

<button onclick="pdfMake.createPdf(docDefinition).download('document.pdf').catch(console.error)">Download PDF</button>
<script>
	const docDefinition = {
		content: ['Hello from pdfmake!']
	};
</script>

Documentation

See the documentation for usage and API details.

Documentation improvements are welcome in the documentation repository.

Building from source

git clone https://github.com/bpampuch/pdfmake.git
cd pdfmake
npm install
npm run build

License

MIT

Authors

pdfmake is based on PDFKit.

Thanks to all contributors.