This is a Deno module that provides native printer bindings for Deno.
deno add @denyncrawford/printers
Note: This package requires the
--unstable-ffi
flag to be set.
import { getPrinters, getPrinterByName, print, printFile } from "jsr:@denyncrawford/printers";
const printers = getPrinters();
const printer = getPrinterByName("HP OfficeJet Pro 8600");
print(printer, "Hello World!");
printFile(printer, "/path/to/file.txt");
To build your own lib binary, run the following command:
cargo build --release --lib