retail-print-kit

Receipt, cash drawer and label printing for Node.js and Electron

retail-print-kit is an open source npm package that prints to ESC/POS thermal receipt printers (Epson and compatibles), Star printers including the TSP100, and ZPL, TSPL and EZPL label printers, over USB, network or serial.

Open the designer Read the guides npm GitHub
npm install retail-print-kit

A plain install is 4 packages and under 2 MB with no native modules. MIT licensed, TypeScript types included, Node 18 or newer.

Print a receipt in ten lines

const { Printer, profiles } = require('retail-print-kit');
const { NetTransport } = require('retail-print-kit/net');

const printer = new Printer(new NetTransport('192.168.1.50'), profiles['epson-tm-t88']);
await printer.open();
printer
  .align('ct').style('b').size(2, 2).text('MY STORE')
  .size(1, 1).style('normal').align('lt')
  .tableCustom([{ text: 'Coffee', width: 0.7 }, { text: '$2.50', align: 'RIGHT', width: 0.3 }])
  .qr('https://example.com/receipt/1042')
  .cut().cashdraw();
await printer.close();

What it does

The designer

Build a receipt or a label visually and export the JSON template your app prints. It runs entirely in your browser; nothing is uploaded.

Receipt template designer with block list, properties and live receipt preview

Label mode has drag-to-position and shows the ZPL, TSPL or EZPL it generates.

Guides

Supported printers

FamilyProfile or encoderCommand set
Epson TM-T88V / VI / VII, TM-T20III, TM-m30epson-tm-t88, epson-tm-t20, epson-tm-m30ESC/POS
Bixolon, Citizen, SNBC, Xprinter, Rongta, HPRT, POS-Xgeneric-escpos, generic-escpos-58ESC/POS
Star TSP650II, TSP700II, mC-Print3star-tsp650, star-mc-print3Star Line Mode
Star TSP100, TSP143star-tsp100Star raster
Zebra label printersencodeZplZPL II
TSC, Xprinter, Rongta label printersencodeTsplTSPL
Godex label printersencodeEzplEZPL

Compared with escpos and node-thermal-printer

retail-print-kitescposnode-thermal-printer
Epson ESC/POS and compatiblesyesyesyes
Star Line Modeyesnoyes
Star raster-only (TSP100 / TSP143)yesnono
Label printers (ZPL, TSPL, EZPL)yesnono
JSON templates and a designeryesnono
HTML / PNG / SVG previewyesnono
Packages a plain install adds (measured Oct 2026)4667

Coming from one of them? Read the migration guide.

Command line

npx retail-print-kit discover --identify          # printers on this network
npx retail-print-kit test --net 192.168.1.50      # test page and status
npx retail-print-kit drawer --usb                 # kick the cash drawer
npx retail-print-kit preview --out receipt.html   # no printer needed

Questions

Does it work in Electron?

Yes, in the main process. The renderer asks for prints over IPC, and the browser build renders previews. See printing receipts from Electron.

Does it need a printer driver?

No. It sends the printer's own commands directly over TCP, USB or serial, so there is no OS print dialog and no driver to install.

Why does my Star TSP100 print nothing with other libraries?

It is a raster-only printer and ignores ESC/POS text. Use the star-tsp100 profile; see the Star TSP100 guide.

Is it free?

Yes. MIT license, source on GitHub.