denyncrawford / deno-printers

A simple rust ffi binding for allowing hardware printing with deno
MIT License
1 stars 1 forks source link

Native Printer Bindings for Deno

This is a Deno module that provides native printer bindings for Deno.

JSR

Installation

deno add @denyncrawford/printers

Note: This package requires the --unstable-ffi flag to be set.

Usage

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");

Building

To build your own lib binary, run the following command:

cargo build --release --lib