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

invoice-print-service

v1.0.5

Published

http printer service

Readme

HTTPService Printer

HTTPService Printer is a Node.js-based service that provides silent printing of HTML content to PDF and physical printers via a REST API. It uses Express, Puppeteer, and pdf-to-printer, and can be installed as a Windows service for always-on printing.


NPM

npm install -g invoice-print-service

Features

  • Exposes HTTP endpoints for printing HTML to a physical printer.
  • Automatically generates PDFs and sends them to the printer.
  • Supports multiple printers and settings.
  • Can run as a Windows service (install/uninstall script included).
  • Uses Puppeteer for rendering HTML and Chrome for PDF generation.


Install the Service

The service.js script allows you to install/uninstall the Express print service as a Windows service.

  1. Open a terminal in the project folder.
  2. Install the service:
printserver install
  • The service is named alen-print-service (or change the name in service.js).
  • The service will start automatically.
  1. To uninstall:
printserver uninstall

API Endpoints

GET /ping

Check if the service is online.

Response:

{
  "printerIsOnline": true
}

GET /printers

List available printers and the default printer.

Response Example:

[
  {
    "deviceId": "Printer1",
    "name": "HP LaserJet",
    "isDefault": true
  },
  {
    "deviceId": "Printer2",
    "name": "Canon Inkjet"
  }
]

POST /print

Print HTML content to a specified printer.

Request Body:

{
  "deviceId": "Printer1",
  "html": "<h1>Hello World</h1>",
  "settings": { "format": "A4" }
}

Response Example:

{
  "printer": { "deviceId": "Printer1", "name": "HP LaserJet" },
  "status": "printed"
}

How It Works

  1. Receives HTML content via POST /print.
  2. Generates a temporary PDF using Puppeteer and Chrome.
  3. Sends the PDF to the selected printer using pdf-to-printer.
  4. Deletes the temporary PDF after printing.
  5. Supports queued printing via printQueue.js.

Logging

Logs are generated using logger.js. You can customize it to output to console, files, or external logging services.


Notes

  • Chrome must be installed and detected by chrome-launcher.
  • Temporary PDFs are stored in the jobs/ folder inside the project directory.
  • The service is silent; no browser windows will open during printing (headless: true).