{"id":19408733,"url":"https://github.com/morglod/morglod-rpc","last_synced_at":"2026-07-06T01:31:20.517Z","repository":{"id":114475893,"uuid":"134861017","full_name":"Morglod/morglod-rpc","owner":"Morglod","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-23T01:45:48.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T02:17:42.042Z","etag":null,"topics":["rpc","rpc-framework","typescript"],"latest_commit_sha":null,"homepage":null,"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/Morglod.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":"2018-05-25T13:38:37.000Z","updated_at":"2018-11-23T01:45:49.000Z","dependencies_parsed_at":"2023-05-16T19:45:26.141Z","dependency_job_id":null,"html_url":"https://github.com/Morglod/morglod-rpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Morglod/morglod-rpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morglod%2Fmorglod-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morglod%2Fmorglod-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morglod%2Fmorglod-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morglod%2Fmorglod-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Morglod","download_url":"https://codeload.github.com/Morglod/morglod-rpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morglod%2Fmorglod-rpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280768914,"owners_count":26387533,"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-24T02:00:06.418Z","response_time":73,"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":["rpc","rpc-framework","typescript"],"created_at":"2024-11-10T12:07:40.035Z","updated_at":"2025-10-24T08:54:20.339Z","avatar_url":"https://github.com/Morglod.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# morglod-rpc\n\nSimple OOP rpc with remote callback support.\n\n!! Install by `--save-exact`, coz still in development.\n\n## Example\n\nServer:\n```ts\nconst httpServer = http.createServer();\nhttpServer.listen(PORT);\n\nconst server = SocketIOServer(httpServer);\nserver.on('connection', socket =\u003e {\n    const transport = new SocketIOTransport(socket);\n\n    // Provide RPC methods to SocketIO connection.\n    new Api({\n        methods: {\n            // `resolve` is remote callback!\n            readFile: (path: string, resolve: (data: string) =\u003e void) =\u003e {\n                fs.readFile(path, 'utf8', (err, data) =\u003e {\n                    if (err) return;\n                    resolve(data);\n                });\n            })\n        }\n    }, transport);\n});\n```\n\nProtocol:\n```ts\ntype ApiDef = {\n    readFile: (path: string, resolve: (data: string) =\u003e void) =\u003e void,\n};\n```\n\nClient:\n```ts\nconst socket = SocketIO.connect(httpBind);\nconst transport = new SocketIOTransport(socket);\nconst api = new Api\u003cApiDef, {}\u003e({}, transport);\n\napi.callMethod('readFile', 'file.txt', (fileData: string) =\u003e {\n    console.log('yeyy!', fileData);\n});\n```\n\n# TODO\n\nAdd middlewares and pre-call hooks","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorglod%2Fmorglod-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorglod%2Fmorglod-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorglod%2Fmorglod-rpc/lists"}