{"id":20801115,"url":"https://github.com/naderio/rerpc","last_synced_at":"2026-04-11T12:01:52.353Z","repository":{"id":57354415,"uuid":"107019739","full_name":"naderio/rerpc","owner":"naderio","description":"an opinionated take on RPC system intended for usage with or without dedicated client library, HTTP request or Socket.IO event.","archived":false,"fork":false,"pushed_at":"2018-01-27T11:40:23.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-12T14:12:17.514Z","etag":null,"topics":["expressjs","http","nodejs","rpc","socket-io"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naderio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-15T14:30:41.000Z","updated_at":"2018-03-25T09:47:15.000Z","dependencies_parsed_at":"2022-09-12T06:00:47.820Z","dependency_job_id":null,"html_url":"https://github.com/naderio/rerpc","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/naderio/rerpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naderio%2Frerpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naderio%2Frerpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naderio%2Frerpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naderio%2Frerpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naderio","download_url":"https://codeload.github.com/naderio/rerpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naderio%2Frerpc/sbom","scorecard":{"id":672701,"data":{"date":"2025-08-11","repo":{"name":"github.com/naderio/rerpc","commit":"75c70582ad89a98f375fe4f0ea69e26f128263f7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: The Unlicense: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-21T20:41:58.395Z","repository_id":57354415,"created_at":"2025-08-21T20:41:58.396Z","updated_at":"2025-08-21T20:41:58.396Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28002253,"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-12-24T02:00:07.193Z","response_time":83,"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":["expressjs","http","nodejs","rpc","socket-io"],"created_at":"2024-11-17T18:16:34.109Z","updated_at":"2025-12-24T12:15:51.281Z","avatar_url":"https://github.com/naderio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nreRPC\n=====\n\n`reRPC` is a simplified and flexible RPC system with unified model for client-to-server and server-to-server communication on top of HTTP and/or Socket.IO.\n\nIt provides an unified approach to define both a HTTP path and a Socket.IO event handlers as a single async function that can be invoked with a dedicated library.\n\n## Status\n\n![Status](https://img.shields.io/badge/status-production--ready-green.svg)\n[![npm](https://img.shields.io/npm/l/rerpc.svg?maxAge=1000)](https://github.com/naderio/rerpc/blob/master/LICENSE.md)\n[![node](https://img.shields.io/node/v/rerpc.svg?maxAge=1000)](https://www.npmjs.com/package/rerpc)\n[![npm](https://img.shields.io/npm/v/rerpc.svg?maxAge=1000)](https://www.npmjs.com/package/rerpc)\n[![dependency Status](https://img.shields.io/david/naderio/rerpc.svg?maxAge=1000)](https://david-dm.org/naderio/rerpc)\n[![devDependency Status](https://img.shields.io/david/dev/naderio/rerpc.svg?maxAge=1000)](https://david-dm.org/naderio/rerpc)\n[![devDependency Status](https://img.shields.io/david/peer/naderio/rerpc.svg?maxAge=1000)](https://david-dm.org/naderio/rerpc)\n[![Build Status](https://travis-ci.org/naderio/rerpc.svg?branch=master)](https://travis-ci.org/naderio/rerpc)\n[![npm](https://img.shields.io/npm/dt/rerpc.svg?maxAge=1000)](https://www.npmjs.com/package/rerpc)\n\n\nThis library is production-ready.\n\nPlease refer to [releases/changelog](https://github.com/naderio/rerpc/releases) and [roadmap](https://github.com/naderio/rerpc/issues/1) for more information. \n\n## Description\n\n`reRPC` enable you to do the following:\n- define an async Node.js function (`lib.doSomething = async (payload) =\u003e { ... ; return result; };`)\n- call the defined function from client by mean of:\n  - client library (`result = await lib.doSomething(payload);`)\n  - HTTP request (`POST /rerpc/doSomething` with payload as JSON in body)\n  - Socket.IO event (`socketio.emit('/rerpc', 'doSomething', payload, (result) =\u003e { ... });`)\n\n`reRPC` exposes defined functions by attaching itself to:\n- `/rerpc` route on an [Express](https://expressjs.com/) app or route instance\n- `/rerpc` event on a [Socket.IO](https://socket.io/) instance\n\n## Goals\n\n- enable writing a function once and call it with dedicated library, HTTP request and/or Socket.IO event\n- simplify function invocation interface by mean of `async/await` and ES2015 `Proxy`\n- stay simple:\n  - do not create and manage transport connection, even in frontend\n  - no middleware, authentication, ...\n  - delegate customisation code to transport (Express and/or Socket.IO)\n- stay flexible:\n  - enable function to access transport layer\n  - enable function context augmentation\n  - enable [payload processing customisation](doc/payload-processing.md)\n  - enable [error handling customisation](doc/error-handling.md)\n  - enable [prefix customisation](doc/prefix.md)\n\n## Requirements\n\n`reRPC` makes use of a number of ES2015+ features, most notably `async/await` and `Proxy`. Therefore:\n\n- Node v8+\n- Transpiler for browser code\n\n## Usage\n\nRefer to [`doc` folder](./doc) for more documentation.\n\n### Server\n\n```javascript\nconst express = require('express');\nconst app = express();\napp.use(express.json());\nconst http = require('http').Server(app);\napp.io = require('socket.io')(http);\nhttp.listen(5000);\n\n// initiate\nconst rerpc = require('rerpc')({});\n\n// define function\nasync function greet({ name }) {\n  return `Hello ${name}!`;\n}\n\n// register function\nrerpc.register({ greet });\n\n// attach to Express app our route, creates '/rerpc' route\nrerpc.attachToExpress(app);\n\n// attach to Socket.IO instance, creates '/rerpc' event\napp.io.on('connect', soc =\u003e rerpc.attachToSocketIO(soc));\n```\n\n### Client\n\n#### Using dedicated library\n\n```javascript\nconst rerpc = require('rerpc/client')({\n  transport: 'http',\n  transportHandler: 'http://localhost:5000',\n});\n\n// or\n\nconst socketio = require('socket.io-client')('http://localhost:5000/');\n\nconst rerpc = require('rerpc/client')({\n  transport: 'socket.io',\n  transportHandler: socketio,\n});\n\n// then\n\ntry {\n  const result = await rerpc.fn.greet({ name: 'World' });\n  console.log(result); // =\u003e \"Hello World!\"\n} catch(error) {\n  console.error(error);\n}\n```\n\n#### Using `CURL`\n\n```bash\ncurl -X POST 'http://localhost:5000/rerpc/greet' -H 'Content-Type: application/json' -d '{\"name\": \"World\"}'\n# =\u003e { \"$result\": \"Hello World!\" } OR {\" $error\": { ... } }\n```\n\n#### Using `fetch`\n\n```javascript\nconst response = await fetch('http://localhost:5000/rerpc/greet', {\n  method: 'post',\n  headers: new Headers({ 'Content-Type': 'application/json' }),\n  body: JSON.stringify({ name: 'World' }),\n});\n\nconst result = await response.json();\n\nconsole.log(result); // =\u003e { \"$result\": \"Hello World!\" } OR { \"$error:\" { ... } }\n```\n\n#### Using Socket.IO\n\n```javascript\nconst socketio = require('socket.io-client')('http://localhost:5000/');\n\nsocketio.emit('/rerpc', 'greet', { name: 'World' }, (result =\u003e {\n  console.log(result); // =\u003e { \"$result\": \"Hello World!\" } OR { \"$error:\" { ... } }\n});\n```\n\n## Code Samples\n\nRefer to [`samples` folder](./samples) for more examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaderio%2Frerpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaderio%2Frerpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaderio%2Frerpc/lists"}