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

urthreads

v1.1.2

Published

A Cloudflare Workers and D1 engagement system for static-site likes and comments.

Readme

Urthreads

| > Overview < | Dashboard | Configuration And Environment | Program Logic | Tests | | --- | --- | --- | --- | --- |

urthreads is self-hosted engagement software for static websites. Deploy the Cloudflare Worker, connect it to your own D1 database, and moderate likes, threaded comments, posts, logs, and stats from the static dashboard.

Overview

It adds page likes, threaded comments, moderation, dashboard analytics, and admin tooling for blogs, portfolios, documentation sites, and other static pages that need interaction without running a traditional server.

Before We Begin...

Special thanks to lostinurarms1 for the logo design. You can submit your own request from their Fiverr page to get a specialized logo!

What It Does

  • Tracks page likes and comment likes by path.
  • Stores comments and replies in Cloudflare D1.
  • Keeps new comments pending until moderated.
  • Supports denied keywords for automatic rejection.
  • Provides a static admin dashboard for moderation, analytics, posts, logs, and Worker metadata.
  • Provides CLI tools for setup, env syncing, admin keys, sessions, dashboard builds, cleanup, stats, and D1 checks.
  • Uses an HttpOnly, Secure admin session cookie after the admin key is submitted once.

Quick Start

npm install -g urthreads
wrangler login
urthreads setup-env

The guided setup can create or reuse a D1 database, write .env, create wrangler.toml, initialize the schema, deploy the Worker, and sync safe browser example config. Create Wrangler config later with:

urthreads wrangler-init

Common follow-up commands:

urthreads wrangler set database_id your-d1-database-id
urthreads env add-origin https://example.com --staging --production
wrangler d1 execute your-threads --remote --file=src/schema.sql
wrangler deploy

For a cloned repository instead of the published package:

npm install
npm run setup:env

See Configuration And Environment for all .env, wrangler.toml, origin, secret, and deployment details.

Website Usage

Configure browser scripts with your Worker endpoints:

<script>
  window.LIKES_CONFIG = { endpoint: "https://your-worker.workers.dev/likes" };
  window.COMMENTS_CONFIG = { endpoint: "https://your-worker.workers.dev/comments" };
</script>
<script src="/path/to/likes.js"></script>
<script src="/path/to/comments.js"></script>

Add a like button:

<button data-like-button data-path="/blog/my-post">
  Like (<span data-like-count>0</span>)
</button>

Add comments:

<div
  data-worker-comments
  data-page-id="/blog/my-post"
  data-page-url="https://example.com/blog/my-post"
  data-page-title="My Post"
>
  <div data-comment-list></div>
  <div data-comment-status></div>
  <form data-comment-draft-form>
    <textarea name="content" required></textarea>
    <button type="submit" data-comment-send>Post</button>
  </form>
</div>

Complete examples live in the examples directory. For static HTML examples, run urthreads setup-env or set WORKER_URL; you can also append ?worker=https://your-worker.workers.dev.

Dashboard

Create dashboard credentials:

urthreads admin-key
urthreads admin-session --ttl 1h

admin-key writes the key to .env, copies it to your clipboard, and can optionally store it as the Worker secret. admin-session syncs session TTL to .env and wrangler.toml, then offers to deploy.

Run the dashboard locally from web/index.html, or host it under your site:

urthreads dashboard set ./public urthreads
urthreads dashboard build

dashboard set stores DASHBOARD_LOCAL_PATH and DASHBOARD_ENDPOINT, builds to ./public/urthreads/, and copies required assets. Later dashboard build refreshes that saved install; if no path is saved, it prompts for one. Missing output paths are created only after confirmation.

For production dashboard hosting, add the dashboard origin, not its path:

urthreads env add-origin https://www.myblog.com
urthreads wrangler set ALLOWED_ORIGINS https://www.myblog.com
wrangler deploy

Then open https://www.myblog.com/urthreads/ and enter your Worker API URL. See Dashboard for UI behavior, login flow, moderation, stats, and responsive layout details.

Cleanup

Use these when testing setup again or backing out a deployment:

urthreads clean --dry-run
urthreads clean
urthreads clean-all
urthreads clean-all --delete-worker
urthreads clean-all --delete-worker --delete-database
urthreads delete-worker --name urthreads-worker

clean removes caches, local working files, and copied dashboard files while keeping database/config files. clean-all also removes .env, wrangler.toml, and .dev.vars; it can delete the Worker and then optionally the inferred D1 database. Dashboard cleanup removes copied urthreads files only, leaving directories and unrelated site files in place.

Development

npm test
npm run check
wrangler dev
python3 -m http.server 8000

Serve the dashboard at http://localhost:8000/web/index.html or http://[::1]:8000/web/index.html. The exact browser origin must be in ALLOWED_ORIGINS for cookie sessions.

More Docs

  • Dashboard: admin UI, login, moderation, stats, and local dashboard development.
  • Configuration And Environment: .env, wrangler.toml, origins, secrets, dashboard path, cleanup, and deployment checklist.
  • Program Logic: Worker endpoints, database behavior, session logic, audit logs, and runtime limits.
  • Tests: test files, local checks, and coverage focus.

Contributing

Contributions are welcome. Before opening a pull request, read CONTRIBUTING.md, keep changes focused, and run:

npm test
npm run check

Please do not report security vulnerabilities in public issues. Use the private reporting guidance in SECURITY.md.

Upcoming Changes

  • Optional Cloudflare Access or identity-provider setup notes for teams that want MFA in front of the dashboard.
  • Widget-style overview display with configurable statistics.
  • Comment approval settings, including auto-approve and rejected-comment cleanup.
  • Broader Worker integration tests for deployed or local Wrangler environments.