Repository
Current version released
3 years ago
Dependencies
ghuc.cc
worker-tools/encrypted-cookie-storeworker-tools/extendable-promiseworker-tools/htmlworker-tools/json-fetchworker-tools/json-streamworker-tools/kv-storageworker-tools/middlewareworker-tools/request-cookie-storeworker-tools/resolvable-promiseworker-tools/response-creatorsworker-tools/routerworker-tools/signed-cookie-storeworker-tools/stream-response
Shed
Shed is the entire collection of Worker Tools under a single roof, which doubles as a complete web framework built for Worker Runtimes.
Work In Progress
Tools
- ๐งญ Worker Router โ Complete routing solution that works across CF Workers, Deno and Service Workers
- ๐ Worker Middleware โ A suite of standalone HTTP server-side middleware with TypeScript support
- ๐ Worker HTML โ HTML templating and streaming response library
- ๐ฆ Storage Area โ Storage abstractions for Cloudflareโs KV and Deno
- ๐ Response Creators โ Factory functions for responses with pre-filled status and status text
- ๐ Stream Response โ Use async generators to build streaming responses for SSE, etcโฆ
- ๐ฅ JSON Fetch โ Drop-in replacements for Fetch API classes with first class support for JSON.
- ๐ฆ JSON Stream โ Utilities for working with streaming JSON.
- ๐ช Request Cookie Store โ An implementation of the Cookie Store API for use in request handlers.
- โฑ Extendable Promise โ A promise that can be delayed/extended via repeated calls to
waitUntil
.
Worker Tools also includes a number of polyfills that help bridge the gap between different Worker Runtimes:
- โ๏ธ HTML Rewriter โ Cloudflareโs HTML Rewriter for use in Deno, browsers, etcโฆ
- ๐ Location Polyfill โ A
Location
polyfill for Cloudflare Workers. - ๐ฆ Deno Fetch Event Adapter โ Dispatches global
fetch
events using Denoโs native HTTP server.
*[SSE]: Server Sent Events
How to Use
Deno users can import Worker Tools directly from GitHub as they are written in TypeScript with fully qualified import specifiers:
import * as shed from 'https://ghuc.cc/worker-tools/shed/index.ts'
For other runtimes such as module bundlers, webpack or esbuild, Worker Tools are distributed as node-ified modules that can be installed via npm and behave like regular npm modules
npm install @worker-tools/shed
*[SSE]: Server Sent Events