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

pagedrop-print-agent

v0.1.1

Published

Polls PageDrop for paid orders and auto-prints them on the shop's local printer.

Readme

PageDrop Print Agent

Runs on the print shop's own computer. Polls PageDrop every few seconds for paid orders, downloads the files, and sends them to the shop's printer automatically — no manual checking of an admin dashboard required.

Setup

The easiest way — no local checkout needed. On the shop's computer, with Node.js 18+ installed:

npx pagedrop-print-agent setup

This walks through registering/pairing with a shop (get a pairing code from /signup first), auto-detects local printers, writes a .env config, and runs a safe dry-run test print. Then start it:

npx pagedrop-print-agent

It starts in dry-run mode by default — it will fetch real jobs and log exactly what it would print, without sending anything to the printer. Watch the log output, confirm the jobs look right, then set PAGEDROP_DRY_RUN=false in .env and restart to start printing for real.

Running from this repo instead

If you're developing against this repo directly rather than the published package: copy .env.example to .env, fill in PAGEDROP_API_BASE_URL, PAGEDROP_PRINT_AGENT_API_KEY, and PAGEDROP_PRINTER_NAME, then npm install && node index.js (or node index.js setup for the wizard).

How it works

  • Polls GET /api/print-agent/jobs every PAGEDROP_POLL_INTERVAL_MS (default 15s), authenticated with the shop's API key.
  • For each order: prints an auto-generated front sheet (order ID + collection code + file count, always B&W/A4), then downloads and prints every file honoring the customer's color/B&W choice, then a back sheet marking the end of that order — so a stack of printed paper is easy to sort by order without checking a screen. See coversheet.js.
  • Reports back printed or print_failed so the order won't be picked up again once done.
  • Failed jobs are retried automatically on the next poll.

Platform support

  • macOS / Linux: uses the system's lp (CUPS) command — full support for color mode and paper size.
  • Windows: best-effort only. Uses the OS's default "Print" handler via PowerShell, which can't control color mode or paper size from the CLI. For real control on Windows, replace the Windows branch in index.js with SumatraPDF's -print-to flag.

Running it continuously

This is a long-running process — the shop needs it running whenever they want auto-print to work. Options:

  • macOS: wrap it in a launchd agent (~/Library/LaunchAgents)
  • Windows: run it as a scheduled task at login, or wrap with pm2 / node-windows
  • Linux: a systemd service

Keeping this yours to resell

Each print shop gets its own PAGEDROP_PRINT_AGENT_API_KEY, scoped to that shop's orders only — one shop's agent can never see or print another shop's files.