1.0.4 • Published 2 months ago

star-thermal-printer v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

Star Thermal Printer

Fork of Klemenn1337/node-thermal-printer with more features for Star thermal printers. For added features see Added Features Section

Installation

npm install star-thermal-printer

Linux specific

Linux requires build-essentials

sudo apt-get install build-essential

Browser specifics

When using inside a browser, the network interface will not work as browsers do not allow opening TCP sockets.
You still need to instruct the compiler to ignore node dependencies. For webpack, it can be done like this:

new webpack.IgnorePlugin({
  resourceRegExp: /^fs$|^net$/,
}),

Features

Refer to Original Readme

Added Features

Set text size for star printers

printer.setTextSize(5,5);         // Set text height (0-5) and width (0-5)

Read errors from printer

import { Errors } from "star-thermal-printer"

printer.execute({waitForResponse: true})
  .then((data) => {
    let errorReadFromPrinter = printer.parseStatusRT(data);
    console.log(errorReadFromPrinter);      // Error.PAPER_END, Error.PAPER_NEAR_END, Error.NONE
  })
  .catch((error) => {
    console.log('Printing error: ' + error)
  });
1.0.2

2 months ago

1.0.4

2 months ago

1.0.3

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago