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

epaper

v1.0.4

Published

Library for display content on a Waveshare 4.3 inch e-Paper screen

Readme

epaper

Coming soon: support for displaying images (from SD card)

Node.js library for the 4.3 Inch E-Paper display by Waveshare

e-paper Display Sample

Install

This project uses serialport, before you install this libary, please have a look at this section of the serialport readme: https://www.npmjs.com/package/serialport#installation-instructions

Installing epaper module:

npm install epaper

Sample Code

Assuming you have the e-paper displayed connected to /dev/cu.usbserial:

const Display = require('epaper').Display;
const display = new Display('/dev/cu.usbserial', true);
 
display.handshake()
    .then(() => display.setColor(Display.BLACK, Display.WHITE))
    .then(display.clear)
    .then(() => display.setFont(Display.ASCII64))
    .then(() => display.displayString('Hello World!', 50, 100))
    .then(() => display.setFont(Display.ASCII48))
    .then(() => display.displayString('github.com/steamedcotton', 50, 180))
    .then(() => display.drawCircle(75, 350, 50))
    .then(() => display.drawFilledCircle(75, 350, 25))
    .then(() => display.drawTriangle(150, 300, 150, 400, 200, 400))
    .then(() => display.drawFillTriangle(150, 300, 200, 300, 200, 400))
    .then(() => display.drawRect(250, 300, 350, 400))
    .then(() => display.drawFilledRect(375, 300, 475, 400))
    .then(() => display.drawLine(50, 420, 475, 420))
    .then(display.update)
    .catch((err) => console.log('Error:', err));

Methods

Utilities

Handshake

After the epaper has powered up, you can send the handshake command to make sure whether the terminal is ready and able to receive commands or data.

handshake()

Clear

Clears the screen using the background color

clear()

Update

Used to refresh and update the display (clears then displays). All the commands sent in the session will be displayed.

update()

Set Color

Sets the foreground and background color of the drawing. The foreground color is used in the display the basic drawings and text. The background color is used for the cleared screen.

setColor(<FORGROUND COLOR>, <BACKGROUND COLOR>)

Colors

The colors can be referenced as static variables on the Display object.

  • Display.WHITE
  • Display.GRAY
  • Display.DARK_GRAY
  • Display.BLACK

Draw

Pixel

drawPixel(<X -> Int>, <Y -> Int>)

Line

Draws a line with the 2 given points (X1, Y1 > X2, Y2).

drawLine(<X1 -> Int>, <Y1 -> Int>, <X2 -> Int>, <Y2 -> Int>)

Rectangle

Draws a rectangle with the two given points (opposite corners)

drawRect(<X1 -> Int>, <Y1 -> Int>, <X2 -> Int>, <Y2 -> Int>)

Filled Rectangle

drawFilledRect(<X1 -> Int>, <Y1 -> Int>, <X2 -> Int>, <Y2 -> Int>)

Circle

Draws a circle with the given point (X, Y) being the center and the third parameter being the radius.

drawCircle(<X1 -> Int>, <Y1 -> Int>, <RADIUS -> Int>) 

Filled Circle

drawFilledCircle(<X1 -> Int>, <Y1 -> Int>, <RADIUS -> Int>) 

Trangle

Draws a triangle using the three points given.

drawTrangle(<X1 -> Int>, <Y1 -> Int>, <X2 -> Int>, <Y2 -> Int>, <X3 -> Int>, <Y3 -> Int>) 

Filled Triangle

drawFilledTriangle(<X1 -> Int>, <Y1 -> Int>, <X2 -> Int>, <Y2 -> Int>, <X3 -> Int>, <Y3 -> Int>) 

Text

Set Font

setFont(<FONT>)

Fonts

The fonts can be referenced as static varibles on the Display object.

English:

  • ASCII32
  • ASCII48
  • ASCII64

Chinese

  • GBK32
  • GBK48
  • GBK64

Display Text

Displays a provided string at the given location using the current forground color and font. Maximum lentgh is 1020 bytes.

displayText(<X -> Int>, <Y -> Int>, <Text -> Sting>);

Resources

  • Waveshare product website: http://www.waveshare.com/4.3inch-e-paper.htm
  • E-paper product manual: http://www.waveshare.com/wiki/4.3inch_e-Paper#How_to_work_with_PC