{"id":20563819,"url":"https://github.com/worker-tools/caplink","last_synced_at":"2026-02-05T05:35:35.630Z","repository":{"id":248476630,"uuid":"828482232","full_name":"worker-tools/caplink","owner":"worker-tools","description":"A modernized fork of Comlink with many open PRs merged and the ability to use proxies in Caplink calls","archived":false,"fork":false,"pushed_at":"2024-11-11T07:29:30.000Z","size":2278,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T03:51:09.489Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","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":"LICENSE","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":"2024-07-14T09:36:14.000Z","updated_at":"2025-01-25T15:53:48.000Z","dependencies_parsed_at":"2024-11-11T08:23:07.647Z","dependency_job_id":"6c3920d4-b6fc-443d-8421-f9f911920952","html_url":"https://github.com/worker-tools/caplink","commit_stats":null,"previous_names":["qwtel/caplink"],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/worker-tools/caplink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Fcaplink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Fcaplink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Fcaplink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Fcaplink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worker-tools","download_url":"https://codeload.github.com/worker-tools/caplink/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Fcaplink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29113741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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:14.580Z","updated_at":"2026-02-05T05:35:35.614Z","avatar_url":"https://github.com/worker-tools.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caplink\n\nA modernized fork of [Comlink](https://github.com/GoogleChromeLabs/comlink) with many open PRs merged and the ability to use proxies as values in Caplink calls.  \n\n```ts\n// file: worker-1.ts\nimport * as Caplink from '@workers/caplink';\nexport class Greeter {\n  helloWorld(name = \"World\") { \n    console.log(`Hello, ${name}!`);\n  }\n}\nexport class W1Fns {\n  static newGreeter() {\n    return Caplink.proxy(new Greeter());\n  }\n}\nCaplink.expose(W1Fns);\n```\n\n```ts\n// file: worker-2.ts\nimport * as Caplink from '@workers/caplink';\nimport type { Greeter } from \"./worker-1.ts\";\n\nexport class W2Fns {\n  static async takeGreeter(greeter: Caplink.Remote\u003cGreeter\u003e) {\n    using greeter_ = greeter; // can opt into explicit resource management\n    await greeter_.helloWorld(\"Worker 2\");\n  } // local resources freed\n}\nCaplink.expose(W2Fns);\n\n```\n\n```ts\n// file: index.ts\nimport * as Caplink from '@workers/caplink';\nimport type { W1Fns } from \"./worker-1.ts\";\nimport type { W2Fns } from \"./worker-2.ts\";\n\nconst w1 = Caplink.wrap\u003ctypeof W1Fns\u003e(\n  new Worker(new URL(\"./worker-1.ts\", import.meta.url), { type: \"module\" }),\n);\nconst w2 = Caplink.wrap\u003ctypeof W2Fns\u003e(\n  new Worker(new URL(\"./worker-2.ts\", import.meta.url), { type: \"module\" }),\n);\n\nusing remoteGreeter = await w1.newGreeter(); \nawait remoteGreeter.helloWorld(); // logs \"Hello, World\" in worker 1\nawait w2.takeGreeter(remoteGreeter);    // logs \"Hello, Worker 2\" in worker 1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworker-tools%2Fcaplink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworker-tools%2Fcaplink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworker-tools%2Fcaplink/lists"}