8000 GitHub - Yukaii/barbarcode: a simple and easy to use barcode scanner toolkit: with CLI with battery included web interface
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

a simple and easy to use barcode scanner toolkit: with CLI with battery included web interface

License

Notifications You must be signed in to change notification settings

Yukaii/barbarcode

Repository files navigation

Barbarcode

npm version

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

Demo

barbarcode-demo-1.mp4

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.

About

a simple and easy to use barcode scanner toolkit: with CLI with battery included web interface

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0