1.1.3 • Published 3 years ago

htmltoescpos v1.1.3

Weekly downloads
2
License
ISC
Repository
github
Last release
3 years ago

HTMLtoESCPOS

This module renders html and allow it to be printed with an POS printer.

results

How it works:

This module uses Puppeteer to render html in a chromium browser in the background. Then a screenshot is taken and printed as a png image using ESCPOS.

example:

    import { closeBrowser, CreateNetworkPrinter } from "htmltoescpos";

    const test = async () => {
        const printer = CreateNetworkPrinter("192.168.0.151");
        await printer.printUrl('https://www.google.com', {
            beep: {count: 2, time: 5}
        });
        await closeBrowser();
    }

    test();