{"id":14752386,"url":"https://github.com/k8w/tsrpc","last_synced_at":"2025-05-13T23:05:23.170Z","repository":{"id":38483678,"uuid":"104830919","full_name":"k8w/tsrpc","owner":"k8w","description":"A TypeScript RPC framework, with runtime type checking and serialization, support both HTTP and WebSocket. It is very suitable for website / APP / games, and absolutely comfortable to full-stack TypeScript developers.","archived":false,"fork":false,"pushed_at":"2025-03-21T03:24:20.000Z","size":2634,"stargazers_count":1815,"open_issues_count":18,"forks_count":196,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-03T01:37:41.284Z","etag":null,"topics":["ajax","axios","backend-framework","express","framework","full-stack","full-stack-developer","full-stack-development","grpc","nestjs","node","nodejs","protobuf","rpc","runtime-type-checking","serialization-algorithm","server-framework","typescript","typescript-rpc-framework","typescript-serialization"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k8w.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-09-26T03:22:12.000Z","updated_at":"2025-04-01T21:24:51.000Z","dependencies_parsed_at":"2024-06-18T14:05:59.193Z","dependency_job_id":"bffe1aae-1aa2-4d13-ada8-036d209a5748","html_url":"https://github.com/k8w/tsrpc","commit_stats":{"total_commits":413,"total_committers":4,"mean_commits":103.25,"dds":"0.26634382566585957","last_synced_commit":"9ab96c3aa98982579782ade3980cd19e3983e5fc"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8w%2Ftsrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8w%2Ftsrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8w%2Ftsrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8w%2Ftsrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k8w","download_url":"https://codeload.github.com/k8w/tsrpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154055,"owners_count":21056535,"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":["ajax","axios","backend-framework","express","framework","full-stack","full-stack-developer","full-stack-development","grpc","nestjs","node","nodejs","protobuf","rpc","runtime-type-checking","serialization-algorithm","server-framework","typescript","typescript-rpc-framework","typescript-serialization"],"created_at":"2024-09-15T05:00:28.351Z","updated_at":"2025-04-10T03:38:41.340Z","avatar_url":"https://github.com/k8w.png","language":"TypeScript","funding_links":[],"categories":["目录"],"sub_categories":[],"readme":"# TSRPC\n\nEN / [中文](https://tsrpc.cn/docs/introduction.html)\n\nA TypeScript RPC framework with runtime type checking and binary serialization.\n\nOfficial site: https://tsrpc.cn (English version is on the way)\n\n## Features\n- Runtime type checking\n- Binary serialization\n- Pure TypeScript, without any decorater or other language\n- HTTP / WebSocket / and more protocols...\n- Optional backward-compatibility to JSON\n- High performance and reliable, verified by services over 100,000,000 users\n\n## Create Full-stack Project\n```\nnpx create-tsrpc-app@latest\n```\n\n## Usage\n\n### Define Protocol (Shared)\n```ts\nexport interface ReqHello {\n  name: string;\n}\n\nexport interface ResHello {\n  reply: string;\n}\n```\n\n### Implement API (Server)\n```ts\nimport { ApiCall } from \"tsrpc\";\n\nexport async function ApiHello(call: ApiCall\u003cReqHello, ResHello\u003e) {\n  call.succ({\n    reply: 'Hello, ' + call.req.name\n  });\n}\n```\n\n### Call API (Client)\n```ts\nlet ret = await client.callApi('Hello', {\n    name: 'World'\n});\n```\n\n## Examples\n\nhttps://github.com/k8w/tsrpc-examples\n\n## Serialization Algorithm\nThe best TypeScript serialization algorithm ever.\nWithout any 3rd-party IDL language (like protobuf), it is fully based on TypeScript source file. Define the protocols directly by your code.\n\nThis is powered by [TSBuffer](https://github.com/tsbuffer), which is going to be open-source.\n\nTypeScript has the best type system, with some unique advanced features like union type, intersection type, mapped type, etc.\n\nTSBuffer may be the only serialization algorithm that support them all.\n\n\n\n## API Reference\nSee [API Reference](./docs/api/tsrpc.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk8w%2Ftsrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk8w%2Ftsrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk8w%2Ftsrpc/lists"}