escpos-ts API - v1.0.0
    Preparing search index...

      escpos-ts API - v1.0.0

      escpos-ts — A strictly-typed TypeScript port of the python-escpos library for ESC/POS thermal receipt printers.

      import { Network, QR_ECLEVEL_M } from 'escpos-ts';

      const printer = new Network({ host: '192.168.1.100', port: 9100 });
      await printer.open();

      printer.hw('INIT');
      printer.setWithDefault({ bold: true, align: 'center' });
      printer.textln('My Shop');
      printer.setWithDefault();

      printer.textln('Ref: Invoice #INV-10042');
      printer.barcode('012345678905', 'EAN13');

      await printer.qr('https://myshop.com', { ec: QR_ECLEVEL_M });

      printer.cut();
      await printer.close();
      Class Transport Package
      Network TCP/IP (net.Socket) built-in Node.js
      Usb USB bulk transfer usb (libusb)
      Dummy In-memory buffer

      Use ProfileManager.listProfiles to see available profiles and ProfileManager.getProfile to resolve one. Pass the profile name to any printer constructor via the profileName option.

      Classes

      BarcodeCodeError
      BarcodeSizeError
      BarcodeTypeError
      CashDrawerError
      CharCodeError
      ConfigNotFoundError
      ConfigSectionMissingError
      ConfigSyntaxError
      DeviceNotFoundError
      Dummy
      Escpos
      EscposError
      EscposImage
      ImageSizeError
      ImageWidthError
      MagicEncode
      Network
      QrHelper
      SetVariableError
      TabPosError
      TextError
      Usb
      USBNotFoundError

      Interfaces

      BarcodeOptions
      CapabilitiesData
      CodePageEntry
      FontProfile
      ImageOptions
      IPrinterConnection
      MediaProfile
      MediaWidth
      NetworkConfig
      PrinterProfile
      ProfileData
      QrHelperOptions
      QrOptions
      TextStyleOptions
      UsbConfig
      UsbDeviceInfo

      Type Aliases

      Alignment
      FontName

      Variables

      BARCODE_FONT_A
      BARCODE_FONT_B
      BARCODE_FORMATS
      BARCODE_HEIGHT
      BARCODE_TXT_ABV
      BARCODE_TXT_BLW
      BARCODE_TXT_BTH
      BARCODE_TXT_OFF
      BARCODE_TYPE_A
      BARCODE_TYPE_B
      BARCODE_TYPES
      BARCODE_WIDTH
      BEEP
      BUZZER
      CAN
      CD_KICK_2
      CD_KICK_5
      CODEPAGE_CHANGE
      CodePages
      CTL_CR
      CTL_FF
      CTL_HT
      CTL_LF
      CTL_SET_HT
      CTL_VT
      DC4
      DLE
      ENQ
      EOT
      ESC
      FS
      GS
      HW_INIT
      HW_RESET
      HW_SELECT
      LINE_DISPLAY_CLEAR
      LINE_DISPLAY_CLOSE
      LINE_DISPLAY_OPEN
      LINESPACING_FUNCS
      LINESPACING_RESET
      NUL
      PANEL_BUTTON_OFF
      PANEL_BUTTON_ON
      PAPER_FULL_CUT
      PAPER_PART_CUT
      ProfileManager
      QR_ECLEVEL_H
      QR_ECLEVEL_L
      QR_ECLEVEL_M
      QR_ECLEVEL_Q
      QR_MICRO
      QR_MODEL_1
      QR_MODEL_2
      RT_MASK_LOWPAPER
      RT_MASK_NOPAPER
      RT_MASK_ONLINE
      RT_MASK_PAPER
      RT_STATUS
      RT_STATUS_ONLINE
      RT_STATUS_PAPER
      S_RASTER_2H
      S_RASTER_2W
      S_RASTER_N
      S_RASTER_Q
      SHEET_ROLL_MODE
      SHEET_SLIP_MODE
      SLIP_EJECT
      SLIP_PRINT_AND_EJECT
      SLIP_SELECT
      TXT_FONT_A
      TXT_FONT_B
      TXT_NORMAL
      TXT_SIZE
      TXT_STYLE

      Functions

      cashDrawerDecSequence
      intLowHigh
      setFont