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

escpos-screen

v3.0.0-alpha.6

Published

Escpos Screen API

Downloads

275

Readme

ESCPOS Screen

Installation

Example

Constructors

Screen(device)

const usbDevice = new escpos.USB();
const usbScreen = new escpos.Screen(usbDevice);

const serialDevice = new escpos.Serial('/dev/ttyUSB0');
const serialScreen = new escpos.Screen(serialDevice);

const bluetoothDevice = new escpos.Bluetooth('01:23:45:67:89:AB', 1);
const bluetoothScreen = new escpos.Screen(bluetoothDevice);

const networkDevice = new escpos.Network('localhost');
const networkScreen = new escpos.Screen(networkDevice);

Methods

clear()

Clears all displayed characters.

clearLine()

Clears the line containing the cursor.

moveUp()

Moves the cursor up one line.

moveLeft()

Moves the cursor one character position to the left.

moveRight()

Moves the cursor one character position to the right.

moveDown()

Moves the cursor down one line.

moveHome()

Moves the cursor to the left-most position on the upper line (home position).

moveMaxRight()

Moves the cursor to the right-most position on the current line.

moveMaxLeft()

Moves the cursor to the left-most position on the current line.

moveBottom()

Moves the cursor to the bottom position.

move(n, m)

Moves the cursor to the nth position on the mth line.

overwrite()

Selects overwrite mode as the screen display mode.

verticalScroll()

Selects vertical scroll mode as the screen display mode.

horizontalScroll()

Selects horizontal scroll mode as the display screen mode.

cursor(display)

Turn cursor display mode on/off.

"display" Refers to the on/off boolean state.

blink(step)

Sets display screen blank interval. "step" Refers to the blink interval. The interval [ON= step × 50 ms] / [OFF = step × 50 ms] is repeated.

timer(h, m)

Sets the counter time and displays it in the bottom right of the screen. "h" Refers to hours: 0≤ h ≤ 23 "m" Refers to minutes: 0≤ m ≤ 59

displayTimer()

Displays the time counter at the right side of the bottom line.

brightness(level)

Sets the brightness of the fluorescent character display tube. "level" Refers to brightness level: 1 ≤ level ≤ 4

reverse(n)

Selects or cancels reverse display of the characters received after this command. "n" Refers selects/cancels reverse boolean state.

text("text", encodeType)

Prints raw text. Raises TextError exception.

For the encode type, see the iconv-lite wiki document. Escpos uses iconv-lite for encoding.

If the type is undefined, the default type is GB18030.

encode("encodeType")

Sets the encoding value globally. default type is GB18030 (Chinese)

close(function callback)

Flush buffer and closes the current device.