UNPKG

3.82 kBMarkdownView Raw
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<!-- - πŸͺ [__Signed Cookie Store__][signed-cookie-store] --- An implementation of the Cookie Store API for use in request handlers. -->
22<!-- - πŸͺ [__Encrypted Cookie Store__][encrypted-cookie-store] --- An implementation of the Cookie Store API for use in request handlers. -->
23<!-- - ⏱ [__Resolvable Promise__][resolvable-promise] --- A promise that is resolvable or rejectable after it was created. -->
24
25Worker 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
56import * as shed from 'https://ghuc.cc/worker-tools/shed/index.ts'
57```
58
59For __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
62npm install @worker-tools/shed
63```
64
65
66*[SSE]: Server Sent Events