node-thermal-printer
Version:
Print on Epson, Star, Tranca, Daruma, Brother and Custom thermal printers with Node.js
18 lines (14 loc) • 403 B
JavaScript
const ThermalPrinter = require('../node-thermal-printer').printer;
const Types = require('../node-thermal-printer').types;
const printer = new ThermalPrinter({
type: Types.EPSON,
interface: process.argv[2],
});
// Print all available charcodes
for (let i = 33; i < 255; i++) {
printer.print(`${i}: `);
printer.add(Buffer.from([i]));
printer.print(', ');
}
printer.cut();
printer.execute();