1 | # Shed
|
2 | __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).
|
3 |
|
4 | ***
|
5 |
|
6 | __Work In Progress__
|
7 |
|
8 | ***
|
9 |
|
10 | ## Tools
|
11 | - π§ [__Worker Router__][router] --- Complete routing solution that works across CF Workers, Deno and Service Workers
|
12 | - π [__Worker Middleware__][middleware] --- A suite of standalone HTTP server-side middleware with TypeScript support
|
13 | - π [__Worker HTML__][html] --- HTML templating and streaming response library
|
14 | - π¦ [__Storage Area__][kv-storage] --- Storage abstractions for [Cloudflare's KV][cloudflare-kv-storage] and [Deno][deno-kv-storage]
|
15 | - π [__Response Creators__][response-creators] --- Factory functions for responses with pre-filled status and status text
|
16 | - π [__Stream Response__][stream-response] --- Use async generators to build streaming responses for SSE, etc...
|
17 | - π₯ [__JSON Fetch__][json-fetch] --- Drop-in replacements for Fetch API classes with first class support for JSON.
|
18 | - π¦ [__JSON Stream__][json-stream] --- Utilities for working with streaming JSON.
|
19 | - πͺ [__Request Cookie Store__][request-cookie-store] --- An implementation of the Cookie Store API for use in request handlers.
|
20 | - β± [__Extendable Promise__][extendable-promise] --- A promise that can be delayed/extended via repeated calls to `waitUntil`.
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | Worker Tools also includes a number of polyfills that help bridge the gap between different Worker Runtimes:
|
26 | - βοΈ [__HTML Rewriter__][html-rewriter] --- Cloudflare's HTML Rewriter for use in Deno, browsers, etc...
|
27 | - π [__Location Polyfill__][location-polyfill] --- A `Location` polyfill for Cloudflare Workers.
|
28 | - π¦ [__Deno Fetch Event Adapter__][deno-fetch-event-adapter] --- Dispatches global `fetch` events using Denoβs native HTTP server.
|
29 |
|
30 | [router]: https://workers.tools/router
|
31 | [middleware]: https://workers.tools/middleware
|
32 | [html]: https://workers.tools/html
|
33 | [kv-storage]: https://workers.tools/kv-storage
|
34 | [cloudflare-kv-storage]: https://workers.tools/cloudflare-kv-storage
|
35 | [deno-kv-storage]: https://workers.tools/deno-kv-storage
|
36 | [response-creators]: https://workers.tools/response-creators
|
37 | [stream-response]: https://workers.tools/stream-response
|
38 | [json-fetch]: https://workers.tools/json-fetch
|
39 | [json-stream]: https://workers.tools/json-stream
|
40 | [request-cookie-store]: https://workers.tools/request-cookie-store
|
41 | [extendable-promise]: https://workers.tools/extendable-promise
|
42 | [html-rewriter]: https://workers.tools/html-rewriter
|
43 | [location-polyfill]: https://workers.tools/location-polyfill
|
44 | [deno-fetch-event-adapter]: https://workers.tools/deno-fetch-event-adapter
|
45 | [signed-cookie-store]: https://workers.tools/signed-cookie-store
|
46 | [encrypted-cookie-store]: https://workers.tools/encrypted-cookie-store
|
47 | [resolvable-promise]: https://workers.tools/resolvable-promise
|
48 |
|
49 | *[SSE]: Server Sent Events
|
50 |
|
51 |
|
52 | ## How to Use
|
53 | __Deno__ users can import Worker Tools directly from GitHub as they are written in TypeScript with fully qualified import specifiers:
|
54 |
|
55 | ```js
|
56 | import * as shed from 'https://ghuc.cc/worker-tools/shed/index.ts'
|
57 | ```
|
58 |
|
59 | 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
|
60 |
|
61 | ```sh
|
62 | npm install @worker-tools/shed
|
63 | ```
|
64 |
|
65 |
|
66 | *[SSE]: Server Sent Events
|