Bun Workers
Practical Bun worker guide covering Web Workers, worker_threads, and pooling for parallel and background tasks.
- CCM score
- 54 of 100
- skills.sh installs
- 425
- GitHub stars
- 257
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers Bun Web Workers, Node.js
worker_threads, and a reusable worker pool with queued task execution - Includes transferable buffers for zero-copy handoff,
SharedArrayBufferwithAtomicsfor shared memory, and a parallel map helper - Documents error handling via
onerrorandonmessageerror, plus graceful shutdown withself.close()and forcedterminate() - Designed for CPU-intensive processing and background tasks that must keep the main thread responsive
Install
$ npx -y skills add secondsky/claude-skills --skill bun-workers -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Bun Workers
Bun supports Web Workers and Node.js worker_threads for parallel execution.
Web Workers
Basic Usage
// main.ts
const worker = new Worker(new URL("./worker.ts", import.meta.url));
worker.postMessage({ type: "start", data: [1, 2, 3, 4, 5] });
worker.onmessage = (event) => {
console.log("Result:", event.data);
};
worker.onerror = (error) => {
console.error("Worker error:", error.message);
};
// worker.ts
self.onmessage = (event) => {
const { type, data } = event.data;
if (type === "start") {
const result = data.map((x) => x * 2);
self.postMessage(result);
}
};
Worker with URL
// Import from file path
const worker = new Worker(new URL("./worker.ts", import.meta.url));
// Or with blob URL
const code = `
self.onmessage = (e) => {
self.postMessage(e.data * 2);
};
`;
const blob = new Blob([code], { type: "application/javascript" });
const worker = new Worker(URL.createObjectURL(blob));
Transferable Objects
// main.ts
const buffer = new ArrayBuffer(1024 * 1024); // 1MB
const view = new Uint8Array(buffer);
view.fill(42);
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Backend & APIs, CLI & Terminal
- First seen
- Jun 3, 2026
Questions
What does the bun-workers skill do?
The bun-workers skill covers Web Workers in Bun, Node.js worker_threads, parallel processing and background tasks. It shows how bun-workers sends messages between the main thread and a worker, and how it shares buffers or memory between them.
How do I install the bun-workers skill?
Run npx -y skills add secondsky/claude-skills --skill bun-workers -y in a project to install bun-workers. After that, the agent can use bun-workers to build a worker pool, run CPU-intensive tasks in parallel, or handle worker errors and termination.
Where does bun-workers sit in the Backend & APIs category?
bun-workers is listed in the Backend & APIs category on Claude Marketplaces, next to entra-app-registration, neon, firebase-basics, firebase-auth-basics and workers-best-practices. Those skills cover other backend topics, while bun-workers focuses only on parallel execution in Bun.
More from secondsky/claude-skills
All 116- Bun Http Server424
- Bun Bundler423
- Turborepo423
- Api Versioning Strategy421
- Recommendation System421
- Logging Best Practices419
- Bun Hot Reloading418
- Claude Hook Writer418
- Claude Code Bash Patterns417
- Plan Interview417
- Bun React Ssr416
- Bun Shell416
- Bun Websocket Server414
- Bun Redis412
- Ml Pipeline Automation412
- Nuxt Core411
- Nuxt Data411
- Bun Ffi409
- Bun Nuxt409
- Bun Jest Migration408
- Bun Macros407
- Multi Ai Consultant407
- Model Deployment405
- Graphql Implementation403
Similar to Bun Workers
More Backend & APIsconcurrency-patternsaj-geddes/useful-ai-prompts479 installsThread-safe concurrency primitives and patterns for parallel work, with reference implementations in TypeScript, Node.js, and Python.
background-jobs-designerpatricio0312rev/skills292 installsDesign reliable background job processing with BullMQ or Celery, retry backoff, and idempotent execution.
bullmq-specialistdavila7/claude-code-templates338 installsExpert guidance for Redis-backed BullMQ job queues, delayed and repeatable jobs, and flow dependencies in Node.js.
batch-processing-jobsaj-geddes/useful-ai-prompts482 installsBackground job system design covering queues, schedulers, and distributed workers for large or long-running work.