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

barbarcode

v0.1.1

Published

[![npm version](https://img.shields.io/npm/v/barbarcode.svg?style=flat-square)](https://www.npmjs.com/package/barbarcode)

Downloads

25

Readme

Barbarcode

npm version

Barbarcode is a simple, open-source barcode scanning service with a server and a mobile client, both implemented in JavaScript.

Demo

https://github.com/user-attachments/assets/6905fc00-624b-4bd9-932c-54c056b6a9ef

Usage

Get started with Barbarcode in four simple steps:

  1. Install the server:
npm install -g barbarcode
# or use npx without installing
  1. Create a config.toml file with your keystroke mappings:
[sessions]
inventory_input = "{barcode}{enter}"
price_check = "{key:F4}{barcode}{enter}"
  1. Start the server with your desired session:
barbarcode -p 8080 -s inventory_input
# or with npx:
npx barbarcode -p 8080 -s inventory_input
  1. Scan the QR code displayed by the server using your mobile device to start scanning barcodes!

Server

The server component handles:

  • Running a WebSocket server for client connections
  • Converting scanned barcodes into keystrokes
  • Managing scanning sessions via CLI

Configuration

The config.toml file defines how barcodes are processed using keystroke patterns:

[sessions]
# Press Enter after the barcode
inventory_input = "{barcode}{enter}"

# Press F4, then type barcode, then Enter
price_check = "{key:F4}{barcode}{enter}"

# Type SKU:, the barcode, Tab, then Quantity:
data_entry = "SKU:{barcode}{tab}Quantity:"

# Wait 500ms, press F5, type barcode, Tab, 1, Enter
complex_input = "{delay:500}{key:F5}{barcode}{tab}1{enter}"

Keystroke Pattern Syntax

  • {barcode}: The scanned barcode value
  • {enter}, {tab}, {esc}: Special keys
  • {delay:ms}: Add delay in milliseconds
  • {up}, {down}, {left}, {right}: Arrow keys
  • {key:X}: Any other key (X)
  • Regular text: Typed as-is

Client

A mobile-first web client that:

  • Automatically opens when scanning the server's QR code
  • Handles barcode scanning through your device's camera

Libraries Used

  • Server:

    • ws: WebSocket server
    • toml: TOML configuration parsing
    • commander: CLI interface
    • qr: QR code generation
    • robotjs: Keystroke emulation
    • ngrok: Public URL tunneling
  • Client:

    • html5-qrcode: QR code scanning
    • quaggaJS: Barcode scanning

License

Barbarcode is open-source and available under the MIT License.

Contributing

Contributions to Barbarcode are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any problems or have any questions, please open an issue on the GitHub repository.