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

@glicogh/print-gateway

v1.0.45

Published

Print gateway for Glico Healthcare microservice

Readme

Print Gateway

A lightweight daemon that runs on a workstation physically connected to printers (USB or LAN), bridging them to the cloud print service via outbound WebSocket. Part of the Glico Healthcare microservice ecosystem.

How It Works

The gateway lives on the machine that has the printers attached. It connects outbound to the print server over WebSocket (no open inbound ports needed), receives print commands, executes them via the OS spooler (CUPS on macOS/Linux, .NET System.Printing on Windows), and streams status updates back.

Installation

From source

git clone <repo-url>
npm install

Config lives at the project root (.env, config/printers.json).

Global CLI

npm install -g @glicogh/print-gateway

Config lives at ~/.config/@glicogh/print-gateway/ (overridable via PRINT_GATEWAY_CONFIG_DIR).

Windows: SumatraPDF is required for printing document formats (PDF, PS, XPS, images). Run print-gateway install-sumatra (or npm run install-sumatra in dev) to auto-download the latest version; the setup wizard will also offer to install it.

Setup

Run the interactive wizard:

# From source
npm run setup

# Global install
print-gateway setup

This generates .env and config/printers.json. The gateway refuses to start without them. On Windows, setup also checks for SumatraPDF and offers to install it.

Running

Development (source only)

npm run dev

Hot-reload via tsx watch.

Direct

# From source
npm run build && node dist/src/index.js

# Global install
print-gateway start

With PM2 (process manager)

# From source
npm run build && npm run start:pm2

# Global install
pm2 start $(npm root -g)/@glicogh/print-gateway/dist/src/index.js --name "print-gateway"

Auto-start on boot

After starting the gateway with PM2 and verifying it works, save the process list and register auto-start:

pm2 save

# macOS / Linux
pm2 startup

# Windows (run as Administrator)
print-gateway install-pm2-boot

Windows: pm2 startup is not supported. print-gateway install-pm2-boot creates a scheduled task that runs pm2 resurrect at system startup as SYSTEM. Run it once as Administrator after pm2 save.

Features

  • WebSocket client — connects to the print server as a client, auto-reconnects on disconnect
  • Printer state broadcast — sends an immediate heartbeat on connection open, then periodic heartbeats to sync printer list
  • Cross-platform — works on Windows (.NET System.Printing) and macOS/Linux (CUPS lp)
  • Progress tracking — polls the OS spooler and streams status back via WebSocket
  • Page selection — print a specific page from a multi-page document via the page option (uses -o page-ranges=N on CUPS, PageMediaRange on Windows)
  • Authentication — auth and account selection via HTTP headers (Authorization, X-Account-Id, X-Gateway-Name) at WebSocket handshake
  • Interactive setupnpm run setup wizard configures .env and printers; remembers previous selections on re-run

Documentation