0.0.1 • Published 7 years ago

lineprinter v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

lineprinter

Print to USB line printers from Node

Usage

const LinePrinter = require("lineprinter");
const printer = await LinePrinter.auto();

await printer.println("Hello, World!");

API

async LinePrinter.list()

Returns the list of printers currently connected.

await LinePrinter.list();
// [ "lp0" ]

async LinePrinter.connect(device)

Returns a new LinePrinter connected to the printer.

const printer = await LinePrinter.connect("lp0");

async LinePrinter.auto()

Returns a LinePrinter connected to the first printer found.

const printer = await LinePrinter.auto();

async LinePrinter#print(data)

Prints data to the printer. Can be a String or Buffer.

await printer.print("Hello");

async LinePrinter#println(data)

Prints data to the printer, followed by a line break.

await printer.println("Hello, World!");