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

ocr-server

v1.0.6

Published

Mobile web app that captures photos and extracts text using a local llama.cpp LLM server

Downloads

763

Readme

OCR Server

A mobile web app that captures photos and extracts text using a local llama.cpp LLM server. Features a queued processing system, real-time status updates, and an accordion-style UI for viewing results.

Features

  • 📱 Mobile-optimized camera interface with live preview
  • ⏳ Queued processing - capture multiple images, process one at a time
  • 🔄 Real-time status updates via polling
  • ✅ Visual status indicators: pending, processing, complete, error
  • 📂 Expandable accordion UI for viewing OCR results
  • 🔒 Self-signed HTTPS (required for mobile camera access)
  • ⚡ CLI options for configuration

Requirements

Installation

Option 1: Install as global command

npm install -g ocr-server

# Then run from anywhere:
ocr-server --help

Option 2: Clone and run manually

# Clone the repository
git clone <repo-url>
cd ocr-server

# Install dependencies
npm install

Usage

Setup llama.cpp server

Download and setup NuMarkdown model

Download NuMarkdown model files from Hugging Face:

wget https://huggingface.co/mradermacher/NuMarkdown-8B-Thinking-GGUF/resolve/main/NuMarkdown-8B-Thinking.f16.gguf
wget https://huggingface.co/mradermacher/NuMarkdown-8B-Thinking-GGUF/resolve/main/NuMarkdown-8B-Thinking.mmproj-f16.gguf
  1. Start llama.cpp server with NuMarkdown:
llama-server -m NuMarkdown-8B-Thinking.f16.gguf --mmproj NuMarkdown-8B-Thinking.mmproj-f16.gguf --port 8080

Note: You can use any compatible vision model with llama.cpp. Simply replace the model paths with your own.

Start the OCR app

# If installed globally, run directly:
ocr-server --help

# Default settings (port 5666, connects to llama.cpp on localhost:8080)
ocr-server

# Custom port
ocr-server --port 3000

# Connect to remote llama.cpp server
ocr-server --llama-host 192.168.1.100 --llama-port 8080

# Bind to specific host
ocr-server --host 127.0.0.1 --port 3000

CLI Options

| Option | Short | Description | Default | |--------|-------|-------------|---------| | --host | -h | Host to bind this server | 0.0.0.0 | | --port | -p | Port for this HTTPS server | 5666 | | --llama-host | - | Host of llama.cpp server | localhost | | --llama-port | - | Port of llama.cpp server | 8080 | | --help | - | Show help message | - |

Browser Interface

  1. Open your mobile browser to: https://<your-server-ip>:5666
  2. Accept the self-signed certificate warning (required for camera access)
  3. Grant camera permissions when prompted
  4. Point the camera at text and tap "Capture & Process"
  5. Watch the queue status update in real-time
  6. Tap completed jobs to expand and view the OCR results

Output

OCR results are saved to the current directory as:

ocr_YYYY-MM-DD_HH-mm-ss.md

How It Works

  1. Frontend: Captures camera frames and sends to backend via POST /api/ocr
  2. Backend: Images are added to an in-memory queue, job ID returned immediately
  3. Worker: Background processor handles one image at a time via llama.cpp API
  4. Real-time updates: Frontend polls GET /api/jobs every 2 seconds
  5. Save: Results written to timestamped .md files with <answer> tags stripped

Development

# Run type checking
tsc --noEmit server.ts

# Start with hot reload
npm run dev

Publishing to npm

# Build the package
npm run build

# Publish to npm
npm publish

License

MIT