Use node.js to communicate with Adafruit/Sparkfun Thermal Printer
Clone or download
xseignard Merge pull request #27 from paulhayes/master
HasPaper demo was broken
Latest commit 564d12f Mar 16, 2018
Failed to load latest commit information.
demo HasPaper demo was broken Mar 16, 2018
images Added a demo gif Jan 27, 2015
test Final version of printing text without line feed Jan 6, 2016
.editorconfig Added testing, ci and code coverage May 21, 2014
.gitignore Added testing, ci and code coverage May 21, 2014
.jshintrc Added testing, ci and code coverage May 21, 2014
.travis.yml Travis should build this lib against 4.2.x version Dec 30, 2015 update readme according to new serialport api Jan 16, 2018
package.json 0.3.8 Jan 6, 2016

Control the Adafruit/Sparkfun thermal printer from node.js

npm Travis Code Climate

Largely inspired by

You can print images, but they need to be 384px wide.

It's a fluent API, so you can chain functions, but don't forget to call print at the end to actually print something!

Crappy schematics

You'll need an USB/Serial converter.



  • install with npm install thermalprinter --save
  • check the demo sample:
var SerialPort = require('serialport'),
	serialPort = new SerialPort('/dev/ttyUSB0', {
		baudrate: 19200
	Printer = require('thermalprinter');

var path = __dirname + '/images/nodebot.png';

serialPort.on('open',function() {
	var printer = new Printer(serialPort);
	printer.on('ready', function() {
			.printLine('first line')
			.printLine('second line')
			.print(function() {