-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Satyendra Singh edited this page Feb 10, 2026
·
3 revisions
Welcome to the comprehensive documentation for @ssxv/node-printer - the production-ready, cross-platform Node.js printing library.
@ssxv/node-printer is a native Node.js addon that solves cross-platform printing challenges:
- Native performance: Built as an N-API addon, not a subprocess wrapper
- Cross-platform: Windows (Winspool) and Linux (CUPS) with unified JavaScript API
- JS-first design: Complex OS printing APIs hidden behind clean functions
- Production-ready: Used in headless servers, kiosks, and desktop applications
The library follows a JS-first philosophy:
- One API, two backends: Same JavaScript code works on Windows and Linux
- Native complexity hidden: You don't need to understand Winspool or CUPS
- Async by design: All operations return Promises, matching JavaScript conventions
- Error normalization: Standard error codes across platforms
Cross-platform printing is notoriously difficult:
- Different operating systems have completely different printing APIs
- Existing Node.js libraries are Windows-only, abandoned, or unreliable
- Raw system APIs require deep platform knowledge
- Production environments need reliable, headless printing
This library solves those problems:
- Single JavaScript API that works everywhere
- Maintained and actively developed
- Production-tested in real applications
- Handles the OS-specific complexity for you
- List and query printers: Discover system printers and their capabilities
- Print documents: PDFs, text files, images using system print drivers
- Raw data printing: Direct printer control for specialized hardware
- Job management: Submit, monitor, and cancel print jobs
- Error handling: Comprehensive error reporting with platform details
- Document printing: Reports, invoices, forms
- Receipt printing: Point-of-sale systems, ESC/POS thermal printers
- Label printing: Shipping labels, product labels
- Server applications: Headless printing in web applications
- Kiosk systems: Unattended printing in public terminals
- No print preview: System print dialogs not supported (by design)
- No PDF generation: Use libraries like PDFKit or Puppeteer for PDF creation
- No printer installation: Cannot install or configure printer drivers
- No macOS support: Currently Windows and Linux only
- No print queue management: Cannot manage system spooler settings
These limitations are intentional design decisions:
- Print dialogs: Server applications and kiosks need programmatic printing
- PDF generation: Many excellent JavaScript PDF libraries exist
- Printer management: OS-level operations belong in system administration tools
- macOS: Requires significant development resources; may be added in future
┌─────────────────┐ ┌─────────────────┐
│ Your Node.js │ │ Your Node.js │
│ Application │ │ Application │
└─────────────────┘ └─────────────────┘
│ │
┌─────────────────┐ ┌─────────────────┐
│ @ssxv/node- │ │ @ssxv/node- │
│ printer (JS) │ │ printer (JS) │
└─────────────────┘ └─────────────────┘
│ │
┌─────────────────┐ ┌─────────────────┐
│ Native Addon │ │ Native Addon │
│ (Windows) │ │ (Linux) │
└─────────────────┘ └─────────────────┘
│ │
┌─────────────────┐ ┌─────────────────┐
│ Winspool │ │ CUPS │
│ (Win32) │ │ (libcups) │
└─────────────────┘ └─────────────────┘
- Printing Concepts - Essential printing concepts for Node.js developers
- printFile vs printRaw - Choose the right function for your needs
- Job Lifecycle and States - Understanding asynchronous printing
- Node Thermal Printer Integration - Integrate with node-thermal-printer for thermal printing
- Platform Notes - Windows and Linux specifics, permissions, and deployment
- GitHub Issues: Report bugs and request features