Last active
July 21, 2017 11:22
-
-
Save zoetrope69/a4de4e19c498ca976c04af5d968a743c to your computer and use it in GitHub Desktop.
Printer code example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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