{"id":20563877,"url":"https://github.com/worker-tools/worker-tools.github.io","last_synced_at":"2025-07-20T12:33:45.708Z","repository":{"id":114438793,"uuid":"327799717","full_name":"worker-tools/worker-tools.github.io","owner":"worker-tools","description":"Tools for writing HTTP servers in Worker Environments such as Cloudflare Workers","archived":false,"fork":false,"pushed_at":"2024-08-14T15:08:54.000Z","size":7438,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T19:39:33.848Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://workers.tools","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/worker-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-08T04:37:22.000Z","updated_at":"2024-08-14T15:08:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7b0ae7d-6e04-4b2a-81d0-e933ee951226","html_url":"https://github.com/worker-tools/worker-tools.github.io","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Fworker-tools.github.io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Fworker-tools.github.io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Fworker-tools.github.io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Fworker-tools.github.io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worker-tools","download_url":"https://codeload.github.com/worker-tools/worker-tools.github.io/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242172123,"owners_count":20083700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T04:21:57.882Z","updated_at":"2025-03-06T08:21:28.966Z","avatar_url":"https://github.com/worker-tools.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\nlayout: landing\nlogo: |\n  \u003cimg src=\"assets/img/logo.svg\" alt=\"Logo\" width=\"172\" height=\"172\"\u003e\ndescription: \u003e\n  Tools for writing HTTP servers in [__Worker Runtimes__](https://workers.js.org/){:.external} such as [__Cloudflare Workers__](https://workers.cloudflare.com).\nbuttons: \u003e\n  [Get Started](#how-to-use){:.btn.btn-primary}\n  [Examples](/examples){:.btn.btn-default style=\"font-weight:normal\"}\nselected_projects:\n  - _projects/worker-news.md\n  - _projects/ghuc.md\n  - _projects/webauthn.md\n---\n\n# Worker Tools\n\nWorker Tools are a collection of TypeScript libraries for writing web servers in [Worker Runtimes][wkrs] such as [Cloudflare Workers][cfws] and [Deno Deploy][dndp]. \n\n[wkrs]: https://workers.js.org\n[cfws]: https://workers.cloudflare.com\n[dndp]: https://deno.com/deploy\n\n* Table of Contents\n{:toc .large-only}\n\n## Tools\n- 🧭 [__Worker Router__][router]{:.flip-title} --- Complete routing solution that works across CF Workers, Deno and Service Workers\n- 🔋 [__Worker Middleware__][middleware]{:.flip-title} --- A suite of standalone HTTP server-side middleware with TypeScript support\n- 📄 [__Worker HTML__][html]{:.flip-title} --- HTML templating and streaming response library\n- 📦 [__Storage Area__][kv-storage]{:.flip-title} --- Key-value store abstraction across [Cloudflare KV][cloudflare-kv-storage], [Deno][deno-kv-storage] and browsers.\n- 🆗 [__Response Creators__][response-creators]{:.flip-title} --- Factory functions for responses with pre-filled status and status text\n- 🎏 [__Stream Response__][stream-response]{:.flip-title} --- Use async generators to build streaming responses for SSE, etc...\n- 🥏 [__JSON Fetch__][json-fetch]{:.flip-title} --- Drop-in replacements for Fetch API classes with first class support for JSON.\n- 🦑 [__JSON Stream__][json-stream]{:.flip-title} --- Streaming JSON parser/stingifier with 1st class support for WHATWG/web streams.\n- 🧱 [__Structured JSON__][structured-json]{:.flip-title} --- Stringify and parse JavaScript values according to Structured Clone Algorithm\n- 🍪 [__Request Cookie Store__][request-cookie-store]{:.flip-title} --- An implementation of the Cookie Store API for use in request handlers.\n- ⏱ [__Extendable Promise__][extendable-promise]{:.flip-title} --- A promise that can be delayed/extended by calling `waitUntil`.\n\u003c!-- - 🍪 [__Signed Cookie Store__][signed-cookie-store]{:.flip-title} --- An implementation of the Cookie Store API for use in request handlers. --\u003e\n\u003c!-- - 🍪 [__Encrypted Cookie Store__][encrypted-cookie-store]{:.flip-title} --- An implementation of the Cookie Store API for use in request handlers. --\u003e\n\u003c!-- - ⏱ [__Resolvable Promise__][resolvable-promise]{:.flip-title} --- A promise that is resolvable or rejectable after it was created. --\u003e\n\nWorker Tools also includes a number of polyfills that help bridge the gap between different Worker Runtimes:\n- ✏️ [__HTML Rewriter__][html-rewriter]{:.flip-title} --- Cloudflare's HTML Rewriter for use in Deno, browsers, etc...\n- 📍 [__Location Polyfill__][location-polyfill]{:.flip-title} --- A `Location` polyfill for Cloudflare Workers.\n- 🦕 [__Deno Fetch Event Adapter__][deno-fetch-event-adapter]{:.flip-title} --- Dispatches global `fetch` events using Deno’s native HTTP server.\n\n### Services\nWorker Tools also maintains a number of (web-) services:\n- ⚙️ [__workers.js.org__][wkrs] --- Educational site about the state of Worker Runtimes.\n- 🦕 [__ghuc.cc__][ghuc] --- Import modules directly from GitHub into Deno with a familiar API. \n\n[router]: _tools/router.md\n[middleware]: _tools/middleware.md\n[html]: _tools/html.md\n[kv-storage]: _tools/kv-storage.md\n[cloudflare-kv-storage]: _tools/cloudflare-kv-storage.md\n[deno-kv-storage]: _tools/deno-kv-storage.md\n[kv-storage-polyfill]: _tools/kv-storage-polyfill.md\n[response-creators]: _tools/response-creators.md\n[stream-response]: _tools/stream-response.md\n[json-fetch]: _tools/json-fetch.md\n[json-stream]: _tools/json-stream.md\n[request-cookie-store]: _tools/request-cookie-store.md\n[extendable-promise]: _tools/extendable-promise.md\n[html-rewriter]: _tools/html-rewriter.md\n[location-polyfill]: _tools/location-polyfill.md\n[deno-fetch-event-adapter]: _tools/deno-fetch-event-adapter.md\n[signed-cookie-store]: _tools/signed-cookie-store.md\n[encrypted-cookie-store]: _tools/encrypted-cookie-store.md\n[resolvable-promise]: _tools/resolvable-promise.md\n[structured-json]: _tools/structured-json.md\n\n[ghuc]: https://ghuc.cc\n[news]: https://worker-news.deno.dev\n\n***\n\nWorker Tools can be used independently or as a web framework via [__Shed__](./shed){:.flip-title}. \n\n## How to Use\n__Deno__ users can import Worker Tools directly from GitHub as they are written in TypeScript with fully qualified import specifiers:\n\n```js\nimport * as shed from 'https://ghuc.cc/worker-tools/shed/index.ts'\n```\n\nFor __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\n\n```sh\nnpm install @worker-tools/shed\n```\n\n[__Shed__](./shed){:.flip-title} is the entire collection of Worker Tools under a single roof, which doubles as a complete web framework built for Worker Runtimes.\n{:.note title=\"FYI\"}\n\n\n## Examples\nWorker Tools currently doesn't have TodoMVC or similar demo projects, \nbut it has two full web services running in the wild that are Open Source and can be used for reference.\n\n- [__ghuc.cc__](_projects/ghuc.md){:.flip-title}\n  An entire web service in a single file that can be deployed to Cloudflare Workers or Deno Deploy (with some extra work).\n  TBD\n\n- [__Worker News__](_projects/worker-news.md){:.flip-title}\n  A Hacker News clone that scraps the site via HTML Rewriter and renders custom streaming HTML via Worker Tools.\n  TBD\n\n\u003c!--projects--\u003e\n\n## Questions\n### What niche do Worker Tools fill?\nWorker Tools are meant to work across Worker Runtimes such as Cloudflare Workers, Deno Deploy and Service Workers in the browser via frontend bundlers.\nThey are *not meant to be used with NodeJS*. Similar frameworks to Worker Tools typically target either just Deno, just Cloudflare Workers, and usually make no mention of Service Workers.\n\nWorker Tools are \"Web Standards Adjacent\", meaning it prioritizes and/or mimic web standards based APIs where possible.\nThe goal is to minimize the number of API patterns frontend developers have to learn when they move into backend development via Worker Runtimes.\n\n\n\n\u003c!-- [^1]: They might work in the future if NodeJS decides to implement a variety of web APIs, \n      such as Web Cryptography (see [__workers.js.org__][wkrs] for a full breakdown). \n      Select modules such as [__Extendable Promise__](./extendable-promise){:.flip-title} might work in NodeJS today. --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworker-tools%2Fworker-tools.github.io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworker-tools%2Fworker-tools.github.io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworker-tools%2Fworker-tools.github.io/lists"}