{"id":50413904,"url":"https://github.com/sunquakes/jsonrpc4js","last_synced_at":"2026-05-31T05:02:30.811Z","repository":{"id":207554078,"uuid":"718162211","full_name":"sunquakes/jsonrpc4js","owner":"sunquakes","description":"A javascript client and server over http or tcp implementation of JSON-RPC 2.0.","archived":false,"fork":false,"pushed_at":"2024-03-04T11:12:46.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-04T16:38:19.220Z","etag":null,"topics":["consul","jsonrpc2","miscroservices","nacos","nodejs","nodejs-client","nodejs-server","typescript"],"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/sunquakes.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}},"created_at":"2023-11-13T14:10:44.000Z","updated_at":"2024-03-04T16:38:19.220Z","dependencies_parsed_at":"2023-12-10T12:34:29.909Z","dependency_job_id":"762840d3-4f19-46ad-a83c-73ae9cf1ee53","html_url":"https://github.com/sunquakes/jsonrpc4js","commit_stats":null,"previous_names":["sunquakes/jsonrpc4js"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/sunquakes/jsonrpc4js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunquakes%2Fjsonrpc4js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunquakes%2Fjsonrpc4js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunquakes%2Fjsonrpc4js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunquakes%2Fjsonrpc4js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunquakes","download_url":"https://codeload.github.com/sunquakes/jsonrpc4js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunquakes%2Fjsonrpc4js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33719601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"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":["consul","jsonrpc2","miscroservices","nacos","nodejs","nodejs-client","nodejs-server","typescript"],"created_at":"2026-05-31T05:02:29.321Z","updated_at":"2026-05-31T05:02:30.804Z","avatar_url":"https://github.com/sunquakes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"English | [🇨🇳 中文](https://github.com/sunquakes/jsonrpc4js/blob/main/README_ZH.md)\n\n# JSONRPC4JS\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.moonquakes.io/guide/javascript.html\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n    \u003cimg width=\"200\" src=\"https://www.moonquakes.io/images/logo.png\" alt=\"jsonrpc4js logo\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/node-%3E=20.8.0-brightgreen.svg?maxAge=2592000\" alt=\"Node\"\u003e\n  \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/sunquakes/jsonrpc4js?color=blue\"\u003e\n  \u003cimg alt=\"jsonrpc4js\" src=\"https://img.shields.io/github/v/release/sunquakes/jsonrpc4js\"\u003e\n\u003c/p\u003e\n\n## Documentation\n\nVisit [https://www.moonquakes.io/guide/javascript.html](https://www.moonquakes.io/guide/javascript.html).\n\n## Quick Start\n\n### Installing\n\n```bash\npnpm add jsonrpc4js\n```\n\n### Server\n\n```ts\nconst { NewServer } = require('jsonrpc4js')\n\nclass TcpRpc {\n  add(a: number, b: number): number {\n    return a + b\n  }\n}\nconst port = 3200\nconst server = NewServer('tcp', port) // Also support http protocol.\nserver.register(new TcpRpc())\nserver.start()\n```\n\n### Client\n\n```ts\nconst { NewClient } = require('jsonrpc4js')\n\nconst client = NewClient('TcpRpc', 'tcp', `localhost:3200`) // Also support http protocol.\nlet res = await client.call('add', 1, 2) // 3\n```\n\n## Service registration \u0026 discovery\n\n### consul\n\n```ts\nconst { Consul } = require('jsonrpc4js')\n\nconst discovery = new Consul('http://localhost:8500')\n\n// Set discovery in server and client.\n// const server = NewServer('tcp', port, discovery)\n// const client = NewClient('TcpRpc', 'tcp', discovery)\n```\n\n### nacos\n\n```ts\nconst { Nacos } = require('jsonrpc4js')\n\nconst discovery = new Nacos('http://localhost:8848')\n\n// Set discovery in server and client.\n// const server = NewServer('tcp', port, discovery)\n// const client = NewClient('TcpRpc', 'tcp', discovery)\n```\n\n## Test\n\n```bash\npnpm test\n```\n\n## License\n\n[Apache-2.0 license](https://github.com/sunquakes/jsonrpc4js/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunquakes%2Fjsonrpc4js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunquakes%2Fjsonrpc4js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunquakes%2Fjsonrpc4js/lists"}