An open API service indexing awesome lists of open source software.

https://github.com/denyncrawford/deno-printers

A simple rust ffi binding for allowing hardware printing with deno
https://github.com/denyncrawford/deno-printers

Last synced: 5 months ago
JSON representation

A simple rust ffi binding for allowing hardware printing with deno

Awesome Lists containing this project

README

          

# Native Printer Bindings for Deno
This is a Deno module that provides native printer bindings for Deno.

[![JSR](https://jsr.io/badges/@denyncrawford/printers)](https://jsr.io/@/)

## Installation

```sh
deno add @denyncrawford/printers
```

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

## Usage

```ts
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:

```sh
cargo build --release --lib
```