{"id":19159093,"url":"https://github.com/miloas/jsonrpc","last_synced_at":"2025-05-07T08:41:56.529Z","repository":{"id":57171365,"uuid":"72782798","full_name":"Miloas/JSONRpc","owner":"Miloas","description":"A simple json-rpc client for nodejs","archived":false,"fork":false,"pushed_at":"2023-04-03T08:25:26.000Z","size":18,"stargazers_count":2,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T20:53:35.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Miloas.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}},"created_at":"2016-11-03T20:12:56.000Z","updated_at":"2023-04-03T08:21:24.000Z","dependencies_parsed_at":"2023-07-25T07:45:00.277Z","dependency_job_id":null,"html_url":"https://github.com/Miloas/JSONRpc","commit_stats":null,"previous_names":["miloas/json-rpc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miloas%2FJSONRpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miloas%2FJSONRpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miloas%2FJSONRpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Miloas%2FJSONRpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Miloas","download_url":"https://codeload.github.com/Miloas/JSONRpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252844957,"owners_count":21813152,"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":[],"created_at":"2024-11-09T08:47:39.760Z","updated_at":"2025-05-07T08:41:56.501Z","avatar_url":"https://github.com/Miloas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONRpc\n\n\u003e json-rpc 2.0 client\n\n## Test\n```javascript\n// to Start an json-rpc 2.0 server \ngo run test/testServer.go\n// do test\nnpm test\n```\n\n## Install\n```bash\nnpm i JSONRpc --save\n```\n\n## Use\n```javascript\nvar JSONRpcClient = require('JSONRpc')\n\nconst client = new JSONRpcClient('localhost', 8080)\n\nclient.call('add', [1,7], (err, ret) =\u003e {\n    // 8\n    if(!err) console.log(ret)\n})\n\n// Promise also support\n(async () =\u003e {\n    let ret = await client.callPromise('add', [1,2])\n    // 3\n    console.log(ret)\n})()\n\n//Json-rpc over websocket\n//It will periodically call add function, and reseive every result from callback\nclient.callOverWs('add', [1, 2], function (err, ret) {\n    console.log(ret)\n}, 1000)\n\n//It will call add once \nclient.callOverWs('add', [1, 2], function(err, ret) {\n    console.log(ret)\n})\n\n//Close the connection\nclient.closeWs()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiloas%2Fjsonrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiloas%2Fjsonrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiloas%2Fjsonrpc/lists"}