{"id":34716307,"url":"https://github.com/benbucksch/jpc","last_synced_at":"2026-05-26T02:03:03.014Z","repository":{"id":146135097,"uuid":"332461617","full_name":"benbucksch/jpc","owner":"benbucksch","description":"Remote procedure calls between JS objects","archived":false,"fork":false,"pushed_at":"2024-02-28T07:37:14.000Z","size":44,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-28T09:56:40.129Z","etag":null,"topics":["interprocess-communication","interprocess-communication-library","ipc","javascript","remote","remote-execution","remote-procedure-call","remote-procedure-calls","rpc"],"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/benbucksch.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}},"created_at":"2021-01-24T13:50:44.000Z","updated_at":"2023-11-24T18:02:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1b3efd9-0e62-4bc5-8ae5-14254839d3c2","html_url":"https://github.com/benbucksch/jpc","commit_stats":{"total_commits":21,"total_committers":3,"mean_commits":7.0,"dds":0.1428571428571429,"last_synced_commit":"dc87c92ef7e661d0687c4f2fbc146f809b47a4cb"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/benbucksch/jpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbucksch%2Fjpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbucksch%2Fjpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbucksch%2Fjpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbucksch%2Fjpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benbucksch","download_url":"https://codeload.github.com/benbucksch/jpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbucksch%2Fjpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33500457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"online","status_checked_at":"2026-05-26T02:00:06.821Z","response_time":63,"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":["interprocess-communication","interprocess-communication-library","ipc","javascript","remote","remote-execution","remote-procedure-call","remote-procedure-calls","rpc"],"created_at":"2025-12-25T00:57:02.189Z","updated_at":"2026-05-26T02:03:03.009Z","avatar_url":"https://github.com/benbucksch.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jpc - Remote procedure calls between JS objects in different processes\n\njpc allows you to call JS objects in other processes. From your JS objects, it automatically\ncreates an API that resembles your object API, just with an `await` in front of every call.\nIt then transmits the call over the channel and call the objects in the remote process,\nand returns the result back to you.\n\nIt can work over various communication channels to communicate with the remote process:\n* [WebSockets](https://github.com/benbucksch/jpc-ws)\n* [Electron IPC](https://github.com/benbucksch/jpc-electron-ipc)\n* DOM events\n* TCP\n\n# API\n\n### Start object\n\nThis is what your client calls initially and gets the first object references from.\n\n### Objects\n\nThe remote API is the same as the local API, just with an `await` prepended to all calls, aside from `new` and setters.\n\n|          | Local object        | Remote object             | Difference                                       |\n|----------|---------------------|---------------------------|--------------------------------------------------|\n| function | `car.startEngine()` | `await car.startEngine()` | same, just with `await`                          |\n| getter   | `car.owner`         | `await car.owner`         | same, just with `await`                          |\n| setter   | `car.owner = val`   | `await car.setOwner(val)` | because setters always return the assigned value |\n| new      | `new Car()`         | `await Car.newRemote()`   | because `new` always returns the object          |\n\n#### Example\n\nGiven an object of class\n```javascript\nclass Movable {\n  constructor() {}\n}\nclass Car extends Movable {\n  constructor() {\n    this.super();\n    this._owner = \"Fred Flintstone\";\n  }\n  startEngine() {\n    console.log(\"Engine started\");\n  }\n  get owner {\n    return this._owner;\n  }\n  set owner(val) {\n    this._owner = val;\n  }\n}\n```\n\nThe local API in the server process is standard JS:\n```\nlet car = new Car();\ncar.owner = \"Wilma\";\nconsole.log(car.owner);\ncar.startEngine();\n```\n\nThe client API in the other process is almost the same, just with an `await` added in front of all calls:\n```\nlet car = await Car.newRemote(); // creates a new object in the server process\nawait car.setOwner(\"Wilma\");\nconsole.log(await car.owner); // shows \"Wilma\" on the client\nawait car.startEngine(); // shows \"Engine started\" on the server\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbucksch%2Fjpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenbucksch%2Fjpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbucksch%2Fjpc/lists"}