EscPosEncoder.js
Browser-based version of the awesome Node.js module EscPosEncoder by @NielsLeenheer
Installation
You can import it as a script tag or use an import statement:
<script src="https://unpkg.com/escposencoder.js@1.0.1/dist/module.js" type="module"></script>
or
import EscPosEncoder from "https://unpkg.com/escposencoder.js@1.0.1/dist/module.js";
Usage
You should be able to use it the same way as is described in the original module
Example:
import EscPosEncoder from "./escposencoder.js";
const posEncoder = new EscPosEncoder();
const encodedImage = posEncoder
.initialize()
.newline()
.text("HELLO WORLD")
.encode();
An example working with Adafruit's Tiny Thermal printer can be found in the example folder.