Skip to content
npm · typescript · workers

Unified worker manager —Droid

A lightweight manager for service workers, shared workers, and web workers in modern JavaScript and TypeScript apps. It abstracts away the boilerplate and browser inconsistencies of worker setup, messaging, and lifecycle so you can offload heavy computation and keep the main thread responsive.

Framework-agnostic

Usable from vanilla JS or alongside React, Vue, and Angular. comlink gives ergonomic RPC-style calls into workers instead of raw postMessage plumbing.

  • Prebuilt workers — canvas, IndexedDB, WebSocket, Supabase shared/DB.
  • Deps — dexie, zod, nanostores, flatbuffers.
TypeScriptLanguage
npmRegistry
comlinkMessaging
MITLicense

What it gives you

Features

Unified worker API

Register, manage, and message service, shared, and web workers through one consistent interface.

Prebuilt workers

Canvas, IndexedDB (DB), WebSocket, and Supabase shared / DB workers ship as ready exports.

comlink-backed messaging

Ergonomic RPC-style calls into workers instead of raw postMessage plumbing.

Robust dependency stack

dexie for IndexedDB, zod for schema validation, nanostores for state, and flatbuffers for compact payloads.

Get started

Usage

install
npm install @kbve/droid

Questions

Frequently asked

What is the Droid package?

Droid is a lightweight, framework-agnostic TypeScript library that manages service workers, shared workers, and web workers behind a unified API, simplifying setup, communication, and lifecycle management so apps can offload heavy work off the main thread.

Which worker types does Droid support?

Droid handles service workers for offline support, shared workers for cross-tab communication, and web workers for parallel processing. It ships prebuilt workers including canvas, IndexedDB, WebSocket, and Supabase shared and DB workers.

Does Droid work with React, Vue, or Angular?

Yes. Droid is framework-agnostic and works in vanilla JavaScript as well as with React, Vue, or Angular. It uses comlink for worker messaging and dependencies such as dexie, zod, and nanostores under the hood.