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

@lastapp/node-printer

v0.8.0

Published

Node.js printer bindings

Downloads

224

Readme

@lastapp/node-printer

Native printer bindings for Node.js and Electron. Enumerate printers, inspect and control print jobs, and send raw or file-based jobs directly to a printer from JavaScript — on Windows (Winspool) and POSIX/macOS (CUPS).

npm version Prebuild Binaries and Publish

Maintained by Last.app (last-tech). This is a hard fork of printer by Ion Lupascu. We keep it current with modern Node and Electron and ship prebuilt binaries.

Supported runtimes

Prebuilt binaries are published for Windows (x64 and ia32). On other platforms the module is compiled from source at install time (see Building from source).

| Runtime | Versions with prebuilt binaries | |---------|---------------------------------| | Node.js | 22, 24, 26 | | Electron | 31–43 |

The minimum supported Node.js version is 22.0.0 (engines.node >= 22.0.0). ABI is constant across an Electron major, so any patch release of a listed major is covered.

Installation

npm install @lastapp/node-printer
# or
yarn add @lastapp/node-printer

prebuild-install fetches a matching prebuilt binary for your platform and runtime. If none is available, it falls back to a source build via node-gyp.

Usage

const printer = require('@lastapp/node-printer');

// List installed printers with their jobs and status
console.log(printer.getPrinters());

// Send a raw job to a specific printer
printer.printDirect({
  data: 'Hello world',
  printer: 'My_Printer',
  type: 'RAW',
  success: (jobId) => console.log('sent, job id:', jobId),
  error: (err) => console.error(err),
});

See the examples directory for more, and types/index.d.ts for the full typed API.

API

| Method | Description | |--------|-------------| | getPrinters() | Enumerate all installed printers with their current jobs and statuses. | | getPrinter(printerName) | Get a specific (or default) printer's info, jobs and status. | | getPrinterDriverOptions(printerName) | Get a printer's driver options such as supported paper sizes. (POSIX only) | | getSelectedPaperSize(printerName) | Get a printer's default paper size from its driver options. (POSIX only) | | getDefaultPrinterName() | Return the default printer name. | | printDirect(options) | Send a job to a printer. Supports CUPS options passed as a JS object. | | printFile(options) | Print a file. (POSIX only) | | getSupportedPrintFormats() | List supported print formats. RAW and TEXT are supported on all OSes. | | getJob(printerName, jobId) | Get a specific job's info, including status. | | setJob(printerName, jobId, command) | Send a command to a job (e.g. 'CANCEL'). | | getSupportedJobCommands() | List supported job commands. 'CANCEL' is supported on all OSes. |

To print a PDF on Windows, convert it to EMF first (e.g. with node-pdfium) and send it as EMF.

Building from source

A source build runs automatically when no prebuilt binary matches your platform/runtime. Requirements:

  • A C++20 toolchain
    • Windows: Visual Studio with the Desktop development with C++ workload
    • macOS: Xcode Command Line Tools
    • Linux: build-essential
  • POSIX only: CUPS development headers (libcups2-dev on Debian/Ubuntu; bundled on macOS)
  • Python 3 (for node-gyp)
npm run rebuild

License

MIT