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

rocketprint

v0.1.0

Published

Node.js SDK for the RocketPrint API — driverless remote printing.

Readme

rocketprint

Node.js SDK for the RocketPrint API — driverless remote printing. Zero dependencies (Node 18+).

Use this SDK in your backend or worker, where your API key stays private.

npm install rocketprint

Save this example as print.mjs (or use the same import in TypeScript):

import RocketPrint from 'rocketprint';
const rp = new RocketPrint(process.env.ROCKETPRINT_API_KEY);

// Find your printer (registered automatically by RocketPrint Station)
const printers = await rp.printers.list();
const zebra = printers.find((p) => p.status === 'online');
if (!zebra) throw new Error('No online printer found');

// Print a ZPL shipping label
const job = await rp.printJobs.create({
  printerId: zebra.id,
  contentType: 'raw_base64',
  content: Buffer.from('^XA^FO50,50^A0N,40,40^FDHello^FS^XZ').toString('base64'),
  title: 'Order #1042 label',
}, { idempotencyKey: 'order-1042-shipping-label' });

// Retrying identical input with the same key returns this job instead of
// printing a second copy. Reusing the key for different input returns 409.

// Wait for a terminal outcome. "completed" means the OS queue accepted the job.
const done = await rp.printJobs.waitFor(job.id);
console.log(done.status); // completed, failed, canceled, expired, or unknown

// Read a stable USB scale measurement from any connected station
const scales = await rp.scales.list();
if (scales.length) {
  const reading = await rp.scales.waitForReading(scales[0].id);
  console.log(reading.massGrams); // canonical grams
  console.log(reading.displayValue, reading.unit); // exactly what the scale displayed
}

CommonJS is also supported: const RocketPrint = require('rocketprint'). TypeScript projects using CommonJS can use import RocketPrint = require('rocketprint'). Types ship with the package; there is no separate @types package to install.

For backend workers, set a request timeout and bounded retries. Create requests are retried only when they carry an idempotency key:

const rp = new RocketPrint(process.env.ROCKETPRINT_API_KEY, {
  timeoutMs: 10_000,
  maxRetries: 2,
});

const controller = new AbortController();
await rp.printers.list({ signal: controller.signal });

If the printer's agent is offline, jobs queue server-side and dispatch automatically when it reconnects.

API

  • rp.printJobs.create(params, { idempotencyKey, signal, timeoutMs, retries }) / .list(query, opts) / .get(id, opts) / .cancel(id, opts) / .waitFor(id, opts)
  • rp.printers.list() / .get(id)
  • rp.scales.list() / .get(id) / .waitForReading(id, opts)

Full REST reference: API docs and OpenAPI schema.

Queue deadlines and printer settings

printJobs.create() accepts expiresInSeconds (10–86400; default 3600). Offline jobs expire instead of printing unexpectedly days later. Only pending jobs can be canceled. waitFor() also stops for expired and unknown. An unknown result means the Station could not confirm the spooler outcome; check the physical printer before creating another job.

Jobs inherit the printer defaults saved in Setup & print. Override with options: { copies, paperSize, color, duplex, landscape }. Copies must be 1–100; paper size is A4, Letter, Legal, or 4x6. RAW jobs accept copies only; encode other settings in ZPL/EPL or the printer language. Unsupported options are rejected. A completed job means the OS print queue accepted it, not proof that paper physically emerged.