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 🙏

© 2026 – Pkg Stats / Ryan Hefner

epson-tm-u220-driver

v1.0.0

Published

Small node.js util to send commands to Epson U220* receipt printers

Downloads

6

Readme

Epson TM-U220* Printer Driver

A TypeScript driver for the Epson TM-U220* receipt printers. Since it uses standard ESC/POS commands, it may work with other compatible printers as well. I only tested it with the TM-U220IID model.

For general ESC/POS printer usage, I recommend using the escpos package. This driver is intended for cases where you need a minimal, specialized solution specifically for TM-U220* series printers.

Installation

npm install epson-tm-u220iid-driver

Usage

Basic Example

import PrinterBuffer, { Alignment, TextSize } from 'epson-tm-u220iid-driver';

const printer = new PrinterBuffer({
    portPath: '/dev/tty.usbserial',  // Your serial port path
    baudRate: 9600,                  // Optional, defaults to 9600
    autoOpen: true                   // Optional, defaults to true
});

// Simple print job
await printer
    .init()
    .text('Hello World!')
    .print();

// Formatted print job
await printer
    .init()
    .align(Alignment.CENTER)
    .size(TextSize.DOUBLE_HEIGHT)
    .text('Double height')
    .align(Alignment.LEFT)
    .init()
    .text('Regular text')
    .feed(3)
    .print();

await printer.close(); // Close the port when done

Text Formatting

The driver supports various text formatting options:

// Alignment
printer.align(Alignment.LEFT);
printer.align(Alignment.CENTER);
printer.align(Alignment.RIGHT);

// Text Size
printer.size(TextSize.NORMAL);
printer.size(TextSize.DOUBLE_HEIGHT);
printer.size(TextSize.DOUBLE_WIDTH);
printer.size(TextSize.DOUBLE_BOTH);

API Reference

Constructor Options

interface PrinterOptions {
    portPath: string;    // Path to the serial port
    baudRate?: number;   // Baud rate (default: 9600)
    autoOpen?: boolean;  // Auto-open port (default: true)
}

Methods

  • init(): Initialize the printer
  • text(text: string): Add text to the buffer
  • align(alignment: Alignment): Set text alignment
  • size(size: TextSize): Set text size
  • feed(lines: number = 2): Feed paper lines
  • clear(): Clear the print buffer
  • print(): Print the buffer contents
  • close(): Close the serial port

Enums

enum Alignment {
    LEFT = '\x1B\x61\x00',
    CENTER = '\x1B\x61\x01',
    RIGHT = '\x1B\x61\x02'
}

enum TextSize {
    NORMAL = '\x1B\x21\x00',
    DOUBLE_HEIGHT = '\x1B\x21\x10',
    DOUBLE_WIDTH = '\x1B\x21\x20',
    DOUBLE_BOTH = '\x1B\x21\x30'
}

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test