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

@noveltyking/pdf-templates

v0.0.2

Published

PDF Templtes for POS

Readme

pdf-formats

A small collection of PDF document formats and helpers built on @react-pdf/renderer. Provides multiple pre-defined visual formats (format1..format4) and a simple loader to pick the right document component and optional data transformer.

Quick Links

Features

  • Multiple visual PDF formats: format1, format2, format3, format4
  • Standard document types supported: invoice, invoice-docket, payment-receipt, purchase-order, purchase-order-report, customer-statement, close-shift-report
  • Simple loader main() to resolve a format’s data transformer and document component
  • Font registration helper for consistent typography across documents

Quick Start

  1. Install dependencies
npm install
  1. Build the bundle
npm run build
# or
npm run build:dist

The build uses Rollup and outputs to dist/ (see package.json scripts).

Usage

The entry utilities are in src/main.js. Use the main default export or loadPdfFormatModules to resolve modules for a given formatType and pdfFile.

Example:

import main from './src/main.js';

const modules = main({ formatType: 'format2', pdfFile: 'invoice' });
// modules => { formatDataTransformer?, documentComponent }

if (modules) {
  const { formatDataTransformer, documentComponent } = modules;
  // If a transformer exists, call it to get data for the document
  // Then render `documentComponent` with @react-pdf/renderer
}

Notes:

  • formatType accepts format1..format4 or numeric aliases 1..4.
  • pdfFile accepts the supported names (e.g. invoice, invoice-docket). See src/main.js for normalization rules.

Formats

All formats are wired in src/format-map.js. Each entry maps to:

  • formatDataTransformer (optional): a function that converts incoming data to the document's expected shape
  • documentComponent: the React PDF component used to render the document

You can add or override formats by editing or extending FORMAT_MAP in src/format-map.js.

Fonts

Call registerPdfFonts() from utils/register-pdf-fonts.js before rendering documents to ensure the TASAExplorer font family is registered.

Building / Publishing

  • Library entry points are configured in package.json via main and module fields. The published package (if applicable) will export the built files from dist/.
  • Use npm run build to produce development bundles and npm run build:dist for a distribution build.

Contributing

  • Keep formats self-contained under src/format{n}/.
  • Add transformers when a document requires non-trivial data mapping.

License

No license specified — add a LICENSE file if you intend to publish.