Skip to content

ESC/POS library written in TypeScript

License

Notifications You must be signed in to change notification settings

code-by-sia/escpos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESC/POS library

Features:

  • Adapters for Network, Serial, and Console (for debugging)
  • Usual text stuff (Bold, Underline, Justification etc.)
  • PNG images
  • Bar code printing (Regular, QR, PDF417)

Usage example:

import Printer from 'escpos-print/Printer';
import { Font, Justification, TextMode } from 'escpos-print/Commands';
import { Network } from 'escpos-print/Adapters';

const adapter = new Network("192.168.0.102", 9100);
const printer = await new Printer(adapter).open();
                           
printer.setFont(Font.A)
       .setJustification(Justification.Center)
       .setTextMode(TextMode.DualWidthAndHeight)
       .writeLine("This is some large centered text")
       .setTextMode(TextMode.Normal)
       .setJustification(Justification.Left)
       .writeLine("Some normal text")
       .feed(4)
       .close()
       .then(() => console.log("Done printing..."));

About

ESC/POS library written in TypeScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 92.2%
  • JavaScript 7.8%