JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20
  • Score
    100M100P100Q39975F
  • License MIT

NodeJS library for generation PDF from HTML

Package Exports

  • hpdf
  • hpdf/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hpdf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hpdf

standard-readme compliant

About

NodeJS library for generating PDF from HTML with pool of browsers (puppeteer) in the background.

Why?

There are enough NodeJS libraries to generate PDF from HTML. Why do you need another one?

  • There is no up-to-date libraries.
  • There is no libraries with pool (but we have to use pooling when we are talking about browser in the background)

Features:

  • Configurable pool of pages (as resources) in the background
  • Fully tested
  • Written in TypeScript

How it works

Table of Contents

Install

npm install hpdf

Usage

import fs from 'fs';
import { PdfGenerator } from './src';

const start = async () => {
    const generator = new PdfGenerator({
        min: 3,
        max: 10,
    });

    const helloWorld = await generator.generatePDF('<html lang="html">Hello World!</html>');
    const github = await generator.generatePDF(new URL('https://github.com/frimuchkov/hpdf'));

    await fs.promises.writeFile('./helloWorld.pdf', helloWorld);
    await fs.promises.writeFile('./github.pdf', github);

    await generator.stop();
}

Maintainers

@frimuchkov

Contributing

PRs accepted. Everything accepted. Feel free to improve everything you wish.

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT © 2022 Andrey Frimuchkov