npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pokusew/escpos

v3.0.8

Published

ESC/POS Printer driver for Node.js

Downloads

25

Readme

ESCPOS

npm escpos channel on discord

ESC/POS Printer driver for Node.js

This is a fork of song940/node-escpos. It is partially rewritten to ES6 but currently it is not actively updated.

Installation

Using npm

npm install @pokusew/escpos --save

If you use USBAdapter:

  • On Linux, you'll need libudev to build libusb.
  • On Ubuntu/Debian: sudo apt-get install build-essential libudev-dev.
  • On Windows, Use Zadig to install the WinUSB driver for your USB device.

Otherwise you will get LIBUSB_ERROR_NOT_SUPPORTED when attempting to open devices.

Example

see example here

API

USBAdapter

open

Printer

text("text")

Prints raw text. Raises TextError exception.

control("align")

Carrier feed and tabs.

align is a string which takes any of the following values:

  • LF for Line Feed
  • FF for Form Feed
  • CR for Carriage Return
  • HT for Horizontal Tab
  • VT for Vertical Tab

align("align")

Set text properties.

align set horizontal position for text, the possible values are:

  • CENTER
  • LEFT
  • RIGHT

Default: left

font type could be A or B. Default: A width is a numeric value, 1 is for regular size, and 2 is twice the standard size. Default: 1 height is a numeric value, 1 is for regular size and 2 is twice the standard size. Default: 1

barcode("code", "barcode_type", width, height, "position", "font")

Prints a barcode.

code is an alphanumeric code to be printed as bar code barcode_type must be one of the following type of codes:

  • UPC-A
  • UPC-E
  • EAN13
  • EAN8
  • CODE39
  • ITF
  • NW7

width is a numeric value in the range between (1,255) Default: 64 height is a numeric value in the range between (2,6) Default: 3 position is where to place the code around the bars, could be one of the following values:

  • ABOVE
  • BELOW
  • BOTH
  • OFF

Default: BELOW

font is one of the 2 type of fonts, values could be:

  • A
  • B

Default: A

Raises BarcodeTypeError, BarcodeSizeError, BarcodeCodeError exceptions.

cut("mode")

Cut paper.

mode set a full or partial cut. Default: full Partial cut is not implemented in all printers.

cashdraw(pin)

Sends a pulse to the cash drawer in the specified pin.

pin is a numeric value which defines the pin to be used to send the pulse, it could be 2 or 5. Raises `CashDrawerError()``

Thanks

License

MIT