{"id":22092175,"url":"https://github.com/pirxpilot/hoot","last_synced_at":"2025-08-20T09:21:04.950Z","repository":{"id":31401048,"uuid":"34964268","full_name":"pirxpilot/hoot","owner":"pirxpilot","description":"Inter-worker message-based communication in the node cluster.","archived":false,"fork":false,"pushed_at":"2017-02-23T06:56:26.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T10:03:46.565Z","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/pirxpilot.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-02T21:40:47.000Z","updated_at":"2018-10-13T19:57:34.000Z","dependencies_parsed_at":"2022-08-03T15:00:18.466Z","dependency_job_id":null,"html_url":"https://github.com/pirxpilot/hoot","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fhoot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fhoot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fhoot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fhoot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirxpilot","download_url":"https://codeload.github.com/pirxpilot/hoot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186925,"owners_count":20574554,"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-12-01T03:08:36.504Z","updated_at":"2025-03-23T23:45:24.392Z","avatar_url":"https://github.com/pirxpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Dependency Status][gemnasium-image]][gemnasium-url]\n\n# hoot\n\nInter-worker message-based communication in the node cluster.\nBased on [this gist](https://gist.github.com/jpoehls/2232358).\n\n## Install\n\n```sh\n$ npm install --save hoot\n```\n\n## Usage\n\n```js\nvar hoot = require('hoot');\n\n// in cluster master when creating workers\nworker = cluster.fork();\nhoot.registerWorker(worker);\n\n// in worker\nhoot.send('rainbow', { colors: 7 });\n\nhoot.on('rainbow', function(data) {\n  // all workers will see that\n  console.log('Rainbow has ', data.colors, ' colors');\n});\n```\n\n## API\n\n### `hoot.send(message, data)`\n\nAny worker can call `send` to broadcast `message` to all running workers.\n`data` can be passed along the message to the `listener`\n\n### `hoot.on(message, listener)`\n\nWorker registers listener function for each `message` separately.\n`listener` receives message `data` as its argument.\n\n### `hoot.registerWorker(worker)`\n\nCluster master needs to call `registerWorker` for all workers that participate in message exchange.\n\n## License\n\nMIT © [Damian Krzeminski](https://pirxpilot.me)\n\n[npm-image]: https://img.shields.io/npm/v/hoot.svg\n[npm-url]: https://npmjs.org/package/hoot\n\n[travis-url]: https://travis-ci.org/pirxpilot/hoot\n[travis-image]: https://img.shields.io/travis/pirxpilot/hoot.svg\n\n[gemnasium-image]: https://img.shields.io/gemnasium/pirxpilot/hoot.svg\n[gemnasium-url]: https://gemnasium.com/pirxpilot/hoot\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fhoot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirxpilot%2Fhoot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fhoot/lists"}