@worker-tools/shed
Version:
Shed is the entire collection of Worker Tools under a single roof, which doubles as a complete web framework built for Worker Runtimes.
67 lines (52 loc) β’ 3.82 kB
Markdown
# Shed
__Shed__ is the entire collection of [__Worker Tools__](https://workers.tools) under a single roof, which doubles as a complete web framework built for [Worker Runtimes](https://workers.js.org).
***
__Work In Progress__
***
## Tools
- π§ [__Worker Router__][router] --- Complete routing solution that works across CF Workers, Deno and Service Workers
- π [__Worker Middleware__][middleware] --- A suite of standalone HTTP server-side middleware with TypeScript support
- π [__Worker HTML__][html] --- HTML templating and streaming response library
- π¦ [__Storage Area__][kv-storage] --- Storage abstractions for [Cloudflare's KV][cloudflare-kv-storage] and [Deno][deno-kv-storage]
- π [__Response Creators__][response-creators] --- Factory functions for responses with pre-filled status and status text
- π [__Stream Response__][stream-response] --- Use async generators to build streaming responses for SSE, etc...
- π₯ [__JSON Fetch__][json-fetch] --- Drop-in replacements for Fetch API classes with first class support for JSON.
- π¦ [__JSON Stream__][json-stream] --- Utilities for working with streaming JSON.
- πͺ [__Request Cookie Store__][request-cookie-store] --- An implementation of the Cookie Store API for use in request handlers.
- β± [__Extendable Promise__][extendable-promise] --- A promise that can be delayed/extended via repeated calls to `waitUntil`.
<!-- - πͺ [__Signed Cookie Store__][signed-cookie-store] --- An implementation of the Cookie Store API for use in request handlers. -->
<!-- - πͺ [__Encrypted Cookie Store__][encrypted-cookie-store] --- An implementation of the Cookie Store API for use in request handlers. -->
<!-- - β± [__Resolvable Promise__][resolvable-promise] --- A promise that is resolvable or rejectable after it was created. -->
Worker Tools also includes a number of polyfills that help bridge the gap between different Worker Runtimes:
- βοΈ [__HTML Rewriter__][html-rewriter] --- Cloudflare's HTML Rewriter for use in Deno, browsers, etc...
- π [__Location Polyfill__][location-polyfill] --- A `Location` polyfill for Cloudflare Workers.
- π¦ [__Deno Fetch Event Adapter__][deno-fetch-event-adapter] --- Dispatches global `fetch` events using Denoβs native HTTP server.
[router]: https://workers.tools/router
[middleware]: https://workers.tools/middleware
[html]: https://workers.tools/html
[kv-storage]: https://workers.tools/kv-storage
[cloudflare-kv-storage]: https://workers.tools/cloudflare-kv-storage
[deno-kv-storage]: https://workers.tools/deno-kv-storage
[response-creators]: https://workers.tools/response-creators
[stream-response]: https://workers.tools/stream-response
[json-fetch]: https://workers.tools/json-fetch
[json-stream]: https://workers.tools/json-stream
[request-cookie-store]: https://workers.tools/request-cookie-store
[extendable-promise]: https://workers.tools/extendable-promise
[html-rewriter]: https://workers.tools/html-rewriter
[location-polyfill]: https://workers.tools/location-polyfill
[deno-fetch-event-adapter]: https://workers.tools/deno-fetch-event-adapter
[signed-cookie-store]: https://workers.tools/signed-cookie-store
[encrypted-cookie-store]: https://workers.tools/encrypted-cookie-store
[resolvable-promise]: https://workers.tools/resolvable-promise
*[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:
```js
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
```sh
npm install @worker-tools/shed
```
*[SSE]: Server Sent Events