Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

qz-tray

qzind187kLGPL-2.12.2.5TypeScript support: definitely-typed

Connects a web client to the QZ Tray software. Enables printing and device communication from javascript.

Printing, USB, Serial, RS232, USB, Scales, Zebra, Epson, Star, Citizen, BOCA

readme

const qz = require("qz-tray");

qz.websocket.connect().then(() => {
    return qz.printers.find();
}).then((printers) => {
    console.log(printers);
    let config = qz.configs.create('PDF');
    return qz.print(config, [{
        type: 'pixel',
        format: 'html',
        flavor: 'plain',
        data: '<h1>Hello JavaScript!</h1>'
    }]);
}).then(() => {
    return qz.websocket.disconnect();
}).then(() => {
    // process.exit(0);
}).catch((err) => {
    console.error(err);
    // process.exit(1);
});