{"id":15687312,"url":"https://github.com/healeycodes/deno-isolate-web-request","last_synced_at":"2025-08-20T03:52:17.839Z","repository":{"id":112377984,"uuid":"600053476","full_name":"healeycodes/deno-isolate-web-request","owner":"healeycodes","description":"🌎 Making web requests from inside an isolate","archived":false,"fork":false,"pushed_at":"2023-02-12T22:14:55.000Z","size":22,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T13:27:31.448Z","etag":null,"topics":["deno","isolate","webrequest"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/healeycodes.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":"2023-02-10T13:32:44.000Z","updated_at":"2025-02-01T13:59:57.000Z","dependencies_parsed_at":"2023-05-18T04:16:05.249Z","dependency_job_id":null,"html_url":"https://github.com/healeycodes/deno-isolate-web-request","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/healeycodes%2Fdeno-isolate-web-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/healeycodes%2Fdeno-isolate-web-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/healeycodes%2Fdeno-isolate-web-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/healeycodes%2Fdeno-isolate-web-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/healeycodes","download_url":"https://codeload.github.com/healeycodes/deno-isolate-web-request/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252945143,"owners_count":21829544,"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","isolate","webrequest"],"created_at":"2024-10-03T17:47:10.559Z","updated_at":"2025-05-07T19:41:02.365Z","avatar_url":"https://github.com/healeycodes.png","language":"Rust","readme":"# making a web request from within an isolate\n\nOn the Deno blog, [Roll your own JavaScript runtime](https://deno.com/blog/roll-your-own-javascript-runtime) shows you how to write a JavaScript runtime, based on the V8 JavaScript engine, using parts of Deno. The example code can read and write to files and has a simplified console API.\n\nThis repository builds on that runtime and adds a global object called `request` that lets you make GET/POST web requests from within the runtime.\n\nThe bindings for `request` are set up in `runtime/src/main.rs` and `runtime/src/minijs.js`.\n\ne.g.\n\n```js\nconst getExample = await request.get(\"http://healeycodes.com\", {\n  \"someHeaderKey\": \"someHeaderValue\",\n});\nconsole.log({\n  status: getExample.status,\n  headers: getExample.headers,\n  url: getExample.url,\n  body: getExample.body,\n});\n```\n\nI'm not super familiar with the Deno project, so I've only worked on this enough to get it working – I'm not using _Denoisms_ like zero-copy, etc.\n\n## HTTP Server\n\nThere's also a HTTP server that accepts user code and evaluates it within the runtime.\n\nSo to play around, you can run the server with `cargo run` and then send some code like `curl -X POST -d 'console.log(await request.get(\"https://healeycodes.com\", {}));' localhost:3000`. `console.log` prints to the server's stdout.\n\nErrors are returned to the client e.g. `curl -X POST -d 'unknown;' localhost:3000` sends back `ReferenceError: unknown is not defined at at ...`\n\nFor real production example, look at how Deno's `fetch` function is setup: https://github.com/denoland/deno/tree/main/ext/fetch\n\n## Run\n\nRun the server: `cd runtime \u0026\u0026 cargo run`\n\nSend some code: `curl -X POST -d 'unknown;' localhost:3000`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhealeycodes%2Fdeno-isolate-web-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhealeycodes%2Fdeno-isolate-web-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhealeycodes%2Fdeno-isolate-web-request/lists"}