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 🙏

© 2025 – Pkg Stats / Ryan Hefner

printerprinter

v0.3.4

Published

socket based thermal printer components

Downloads

3

Readme

PrinterPrinter

printerprinter

Description

PrinterPrinter is a standalone/companion project for connecting a raspberrypi zero attached thermal printer via socket.io to an exisiting nodejs environment

Installation

Client

Build

  • Instructions for building the physical client coming soon ...

Install

  • Follow the instruction in the link below to set up your raspberry pi
    Install RaspberryPi

  • Add a empty file namedssh to the /boot directory of the SD Card

  • Add a wpa_supplicant.conf to the /boot directory of the SD Card with the following content:

country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="<YOUR_WIFI_SSID>"
    scan_ssid=1
    psk="<YOUR_WIFI_PASSWORD>"
    key_mgmt=WPA-PSK
}
  • Run this command to install and configure the client
wget -O - https://raw.githubusercontent.com/florianporada/printerprinter/master/scripts/install_client.sh | bash
  • (Optional) Add $GITHUB_ACCESS_TOKEN=<gist-enabled-access-token> scripts/post_ip_gist.sh to run during boot to get the ip of the printer (headless)

Usage

Automatic

If you use the install script above, the client will install all necessary packages and configure the service to run on startup. You can go to http://<ip-of-client>:8080/ to configure printerprinter client.

Manual

You can either use a .env file to configure the printer or use a lowdb file for get/set the configuration. Set PRINTER_CONFIG_MODE to db or env to switch between the two modes.

PRINTER_CONFIG_MODE='<db|env>' # mode for handling the config
PRINTER_SOCKET_URL='http://socketurl:3030/' # URL to the service
PRINTER_WEBSERVER_PORT=8080 # Port for the web ui
PRINTER_NAME='Printy McPrintface'
PRINTER_UID=0 # Identifier for the service when sending a job
PRINTER_BAUDRATE=9600 # Baudrate of the printer
PRINTER_SERIALPORT='/dev/ttyS0' # Port where printer is connected
PRINTER_LED=12 # Pin of the info LED
  • Install printerprinter via npm
npm i printerprinter
  • Initialize the client component in your codebase.
import { PrinterClient } from "printerprinter";

const printer = new PrinterClient({
  url: "http://socketurl:3030", // points to the socketserver explained below
  name: "Printy McPrintface",
  uid: 0,
  baudrate: 9600,
  serialport: "/dev/ttyS0",
  ledpin: 12,
});

printer.init();

Server

Install

  • Install printerprinter via npm
npm i printerprinter
  • If the prepare script is not executed try:
cd node_modules/printerprinter
npm install && npm run build

Usage

Initialize the service

import { PrinterService } from "printerprinter";

const printerService = new PrinterService({
  port: 3030, // defines the port for the socket service
});

printerService.init();

To send something to the printer:

printerService
  .print({
    message: {
      text: "foo",
      image: "<base64 encoded image>",
      sender: "bar",
    },
    printerUid: 0,
  })
  .then((res) => console.log(res))
  .catch((err) => console.log(err));

Troubleshooting / Additional Notes

  • ...

Credits