escposencoder.js
v1.0.1
Published
Browser-based version of the awesome Node.js module [EscPosEncoder](https://github.com/NielsLeenheer/EscPosEncoder) by [@NielsLeenheer](https://github.com/NielsLeenheer)
Downloads
13
Readme
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/[email protected]/dist/module.js" type="module"></script>
or
import EscPosEncoder from "https://unpkg.com/[email protected]/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.