{"id":23468408,"url":"https://github.com/val-town/deno-http-worker","last_synced_at":"2025-07-16T02:46:04.607Z","repository":{"id":233365858,"uuid":"787107960","full_name":"val-town/deno-http-worker","owner":"val-town","description":"Securely spawn Deno workers from Node.js","archived":false,"fork":false,"pushed_at":"2025-05-23T21:21:27.000Z","size":154,"stargazers_count":19,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-07T11:09:37.230Z","etag":null,"topics":["deno","sandboxing","worker"],"latest_commit_sha":null,"homepage":"","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/val-town.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,"zenodo":null}},"created_at":"2024-04-15T22:45:44.000Z","updated_at":"2025-05-12T20:51:57.000Z","dependencies_parsed_at":"2024-06-07T16:26:07.681Z","dependency_job_id":"aaabfab5-e52a-4076-9ddc-bda6416a37fc","html_url":"https://github.com/val-town/deno-http-worker","commit_stats":null,"previous_names":["val-town/deno-http-worker"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/val-town/deno-http-worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/val-town%2Fdeno-http-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/val-town%2Fdeno-http-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/val-town%2Fdeno-http-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/val-town%2Fdeno-http-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/val-town","download_url":"https://codeload.github.com/val-town/deno-http-worker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/val-town%2Fdeno-http-worker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265477308,"owners_count":23773029,"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":["deno","sandboxing","worker"],"created_at":"2024-12-24T13:53:02.075Z","updated_at":"2025-07-16T02:46:04.585Z","avatar_url":"https://github.com/val-town.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno-http-worker\n\n[![NPM version](https://img.shields.io/npm/v/deno-http-worker.svg?style=flat)](https://npmjs.org/package/deno-http-worker)\n\nSimilarly to [deno-vm](https://github.com/casual-simulation/node-deno-vm), deno-http-worker lets you securely spawn Deno http servers.\n\n## Usage\n\n```ts\nimport { newDenoHTTPWorker } from 'deno-http-worker';\n\nlet worker = await newDenoHTTPWorker(\n    `export default {\n        async fetch(req: Request): Promise\u003cResponse\u003e {\n            return Response.json({ ok: req.url });\n        },\n    }`,\n    { printOutput: true, runFlags: [\"--allow-net\"] }\n);\n\nconst body = await new Promise((resolve, reject) =\u003e {\n    const req = worker.request(\"https://hello/world?query=param\", {}, (resp) =\u003e {\n        const body = [];\n        resp.on(\"error\", reject);\n        resp.on(\"data\", (chunk) =\u003e {\n            body.push(chunk);\n        });\n        resp.on(\"end\", () =\u003e {\n            resolve(Buffer.concat(body).toString());\n        });\n    })\n    req.end();\n})\nconsole.log(body) // =\u003e {\"ok\":\"https://hello/world?query=param\"}\n\nworker.terminate();\n```\n\n## Internals\n\nDeno-http-worker connects to the Deno process over a Unix socket to make requests.  As a result, the worker does not provide an address or url, but instead returns `request` function that calls `http.request` under the hood, but modifies the request attributes to work over the socket.\n\nIf you need more advanced usage here, or run into bugs, please open an issue.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fval-town%2Fdeno-http-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fval-town%2Fdeno-http-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fval-town%2Fdeno-http-worker/lists"}