Skip to content

Instantly share code, notes, and snippets.

@zoetrope69
Last active July 21, 2017 11:22
Show Gist options
  • Save zoetrope69/a4de4e19c498ca976c04af5d968a743c to your computer and use it in GitHub Desktop.
Save zoetrope69/a4de4e19c498ca976c04af5d968a743c to your computer and use it in GitHub Desktop.
Printer code example
const SerialPort = require('serialport')
const serialPort = new SerialPort('/dev/ttyUSB0', { baudrate: 19200 })
const Printer = require('thermalprinter');
const printer = new Printer(serialPort);
printer.on('ready', () => {
printer.printImage(imagePath).print();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment