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

prototype-annotator

v0.2.3

Published

In-browser annotation capabilities with SQLite persistence and template-based prompt generation

Readme

Prototype Annotator

An Express middleware that enables in-browser annotation capabilities for collecting feedback on prototypes and designs. Features SQLite persistence, a Preact-based overlay UI, a management dashboard, and template-based prompt generation.

Features

  • In-Browser Annotations: Add annotations directly on any page with element or rectangle selection
  • Shadow DOM Isolation: Overlay UI is completely isolated from your app's styles
  • Persistent Storage: All annotations stored in SQLite with full event history
  • Management Dashboard: Browse, filter, and manage annotations across all pages
  • Prompt Generation: Generate structured prompts from annotations using templates
  • Audit Trail: Complete event history for all annotation changes

Installation

npm install prototype-annotator

Requirements

  • Node.js >= 18.0.0
  • Express >= 4.18.0

Quick Start

import express from 'express';
import { createPrototypeAnnotator } from 'prototype-annotator';

const app = express();

async function main() {
  // Initialize the annotator (async)
  const annotator = await createPrototypeAnnotator({
    basePath: '/__prototype-annotator',
    dbPath: './data/annotations.sqlite',
    exportDir: './exports',
  });

  // Add the middleware
  app.use(annotator.middleware());

  // Your routes...
  app.get('/', (req, res) => {
    res.send('<html><body><h1>Hello World</h1></body></html>');
  });

  app.listen(3000, () => {
    console.log('Server running at http://localhost:3000');
  });
}

main();

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | basePath | string | '/__prototype-annotator' | Base path for API and dashboard routes | | dbPath | string | './prototype-annotator/annotator.sqlite' | Path to SQLite database file | | exportDir | string | './prototype_annotator_exports' | Directory for exported prompts | | urlMode | 'full' | 'canonical' | 'full' | How URLs are stored (full URL or canonical without query/hash) | | actorMode | 'prompt' | 'fixed' | 'prompt' | Actor identification mode | | defaultActor | string | 'anonymous' | Default actor name | | enableOverlay | boolean | true | Enable the annotation overlay on pages | | enableDashboard | boolean | true | Enable the management dashboard |

Using the Overlay

When enableOverlay is true, an annotation toolbar appears on all HTML pages served by your Express app.

Keyboard Shortcuts

| Key | Action | |-----|--------| | E | Toggle element selection mode | | R | Toggle rectangle selection mode | | S | Toggle sidebar | | Escape | Cancel current selection |

Selection Modes

  • Element Selection: Click on any DOM element to annotate it. The CSS selector is automatically captured.
  • Rectangle Selection: Click and drag to draw a rectangle anywhere on the page.

Dashboard

Access the dashboard at {basePath}/dashboard (e.g., http://localhost:3000/__prototype-annotator/dashboard).

The dashboard provides:

  • Pages: View all pages with annotations
  • Annotations: Browse, filter, and manage all annotations
  • Events: Audit log of all annotation changes
  • Prompts: Generate and export prompts from annotations

API Endpoints

All endpoints are prefixed with {basePath}/api.

Annotations

| Method | Endpoint | Description | |--------|----------|-------------| | GET | /annotations | List annotations (supports ?url= filter) | | GET | /annotations/:id | Get single annotation | | POST | /annotations | Create annotation | | PUT | /annotations/:id | Update annotation | | DELETE | /annotations/:id | Soft-delete annotation | | POST | /annotations/:id/restore | Restore deleted annotation |

Pages & Events

| Method | Endpoint | Description | |--------|----------|-------------| | GET | /pages | List all annotated pages | | GET | /events | List all events (supports filters) |

Prompts

| Method | Endpoint | Description | |--------|----------|-------------| | GET | /prompts/exports | List exported prompts | | POST | /prompts/generate | Generate prompt preview | | POST | /prompts/confirm | Export prompt to files |

Example

Run the included example:

git clone <repo>
cd prototype-annotator
npm install
npm run build
npm run example

Then visit:

  • http://localhost:3000 - Example app with overlay
  • http://localhost:3000/__prototype-annotator/dashboard - Management dashboard

License

MIT