{"id":18563393,"url":"https://github.com/compulim/childprocess-websocket","last_synced_at":"2025-07-09T05:04:46.358Z","repository":{"id":82478811,"uuid":"133267931","full_name":"compulim/childprocess-websocket","owner":"compulim","description":"Turns ChildProcess IPC into WebSocket","archived":false,"fork":false,"pushed_at":"2018-07-19T22:48:53.000Z","size":198,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T18:13:19.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/compulim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-13T19:30:34.000Z","updated_at":"2018-07-19T22:48:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"735c0bb2-00c5-4b80-9a9c-d726861e9074","html_url":"https://github.com/compulim/childprocess-websocket","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/compulim/childprocess-websocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fchildprocess-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fchildprocess-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fchildprocess-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fchildprocess-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compulim","download_url":"https://codeload.github.com/compulim/childprocess-websocket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fchildprocess-websocket/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264396623,"owners_count":23601541,"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-06T22:12:30.283Z","updated_at":"2025-07-09T05:04:46.337Z","avatar_url":"https://github.com/compulim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# childprocess-websocket\n\n[![npm version](https://badge.fury.io/js/childprocess-websocket.svg)](https://badge.fury.io/js/childprocess-websocket) [![Build Status](https://travis-ci.org/compulim/childprocess-websocket.svg?branch=master)](https://travis-ci.org/compulim/childprocess-websocket)\n\nTurns [`ChildProcess`](https://nodejs.org/api/child_process.html) IPC into Web Socket.\n\n# Background\n\nInstead of learning/using different API for different communication channels, we should unite them into a single interface pattern, either [MessagePort](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) or [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket).\n\n# How to use\n\n```js\nconst childProcess = ChildProcess.fork('echo.js');\nconst webSocket = new ChildProcessWebSocket(childProcess);\n\nwebSocket.onmessage = event =\u003e {\n  // Could be either a string or Buffer\n  console.log(event.data);\n};\n\nwebSocket.send('Hello, World!');\n```\n\n\u003e Instead of subscribing to `onmessage`, you can also subscribe using `on('message', handler)`.\n\nNote that when `ChildProcessWebSocket` is constructed, the IPC channel is already established. So we assume Web Socket is already opened, thus, no `open` event will be emitted.\n\n# Contributions\n\nLike us? [Star](https://github.com/compulim/childprocess-websocket/stargazers) us.\n\nWant to make it better? [File](https://github.com/compulim/childprocess-websocket/issues) us an issue.\n\nDon't like something you see? [Submit](https://github.com/compulim/childprocess-websocket/pulls) a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompulim%2Fchildprocess-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompulim%2Fchildprocess-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompulim%2Fchildprocess-websocket/lists"}