printer-tray-client
v1.0.0
Published
Simple JS client for local printer Java tray app
Maintainers
Readme
Printer Client
This project provides a simple JavaScript client for interacting with a local Java QZ-Tray-like application to manage printing tasks. It includes functions to retrieve installed printers and send print requests.
Installation
To install the package, clone the repository and run:
npm installUsage
Importing the Functions
You can import the functions from the printerClient.js file as follows:
import { getPrinters, printText } from './src/printerClient';Getting Installed Printers
To get a list of installed printers, use the getPrinters function:
const printers = await getPrinters();
console.log(printers);Sending a Print Request
To send a print request, use the printText function:
const printerName = 'Your Printer Name';
const content = ['Your content to print'];
const response = await printText(printerName, content);
console.log(response);Testing
To run the tests for this project, use the following command:
npm testLicense
This project is licensed under the MIT License. See the LICENSE file for more details.
