{"id":15408454,"url":"https://github.com/yusukebe/my-first-js-rpc","last_synced_at":"2025-10-05T01:41:19.060Z","repository":{"id":232181399,"uuid":"783676374","full_name":"yusukebe/my-first-js-rpc","owner":"yusukebe","description":"My first JS RPC for Cloudflare Workers","archived":false,"fork":false,"pushed_at":"2024-04-08T11:34:23.000Z","size":988,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-31T19:19:49.833Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yusukebe.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":"2024-04-08T11:04:08.000Z","updated_at":"2024-07-11T06:09:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"77f58baa-7928-4d10-a38f-84d1c625bece","html_url":"https://github.com/yusukebe/my-first-js-rpc","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"a1142e01682eb1294da3dc85315f264509dcd34a"},"previous_names":["yusukebe/my-first-js-rpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yusukebe/my-first-js-rpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fmy-first-js-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fmy-first-js-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fmy-first-js-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fmy-first-js-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yusukebe","download_url":"https://codeload.github.com/yusukebe/my-first-js-rpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Fmy-first-js-rpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278399607,"owners_count":25980329,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-10-01T16:34:08.862Z","updated_at":"2025-10-05T01:41:19.045Z","avatar_url":"https://github.com/yusukebe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My first JS RPC for Cloudflare Workers\n\nThis is my first project using [the PRC feature](https://developers.cloudflare.com/workers/runtime-apis/rpc/) for Cloudflare Workers.\n\n## Features\n\n- Minimal\n- Monorepo with Yarn\n- TypeScript Support\n\n## Structure\n\n```txt\n.\n├── package.json\n├── tsconfig.json\n└── workers\n    ├── calc // A service to provide functions of a calculator\n    │   ├── package.json\n    │   ├── src\n    │   │   └── index.ts\n    │   ├── tsconfig.json\n    │   └── wrangler.toml\n    └── server // A server to use the calc service\n        ├── package.json\n        ├── src\n        │   └── index.ts\n        ├── tsconfig.json\n        └── wrangler.toml\n```\n\n## Codes\n\n`workers/calc/src/index.ts`:\n\n```ts\nimport { WorkerEntrypoint } from 'cloudflare:workers'\n\nexport default class Calc extends WorkerEntrypoint {\n  add(a: number, b: number) {\n    return a + b\n  }\n}\n```\n\n`workers/server/src/index.ts`:\n\n```ts\nimport type Calc from 'calc'\nimport { Hono } from 'hono'\n\ntype Bindings = {\n  CALC: Service\u003cCalc\u003e\n}\n\nconst app = new Hono\u003c{ Bindings: Bindings }\u003e()\n\napp.get('/', async (c) =\u003e {\n  const result = await c.env.CALC.add(1, 2)\n  return c.body(result.toString())\n})\n\nexport default app\n```\n\n## How to try\n\n```sh\nyarn install\nyarn calc:build\nyarn dev\n```\n\n## References\n\n- https://blog.cloudflare.com/javascript-native-rpc\n- https://github.com/sor4chi/minimun-workers-service-bindings-rpc\n\n## Author\n\nYusuke Wada\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukebe%2Fmy-first-js-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyusukebe%2Fmy-first-js-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukebe%2Fmy-first-js-rpc/lists"}