{"id":15725044,"url":"https://github.com/ecto/bolt","last_synced_at":"2025-05-07T13:05:50.715Z","repository":{"id":1632439,"uuid":"2355886","full_name":"ecto/bolt","owner":"ecto","description":":electric_plug: Send messages to any node.js process, anywhere on the Internet.","archived":false,"fork":false,"pushed_at":"2014-04-04T19:43:22.000Z","size":399,"stargazers_count":61,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-07T13:05:45.592Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bolt.io/","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/ecto.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}},"created_at":"2011-09-09T14:33:17.000Z","updated_at":"2024-01-13T23:50:25.000Z","dependencies_parsed_at":"2022-07-18T22:19:10.411Z","dependency_job_id":null,"html_url":"https://github.com/ecto/bolt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fbolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fbolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fbolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fbolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecto","download_url":"https://codeload.github.com/ecto/bolt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252883206,"owners_count":21819160,"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-10-03T22:19:06.031Z","updated_at":"2025-05-07T13:05:50.694Z","avatar_url":"https://github.com/ecto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bolt\n\nDistributed realtime EventEmitters through Redis pubsub what\n\n![bolt](http://i.imgur.com/nMj8o.png)\n\n## Send messages to any process, anywhere on the Internet.\n\n**bolt** intercepts EventEmitter API calls and shares them between processes.\n\n## features\n\n  - Realtime monitoring with **bolt-monitor**\n  - Autoreconnection\n  - Authentication\n  - Event stream piping (soon) (pull request!)\n  - Remote Method Invocation (soon) (pull request!)\n  - Method sharing through function decomposition and reconstruction across nodes (soon) (pull request!)\n\n## install\n\n    npm install bolt\n\n## example\n\nBring it in like this:\n\n````javascript\nvar bolt = require('bolt');\n\nvar mesh = new bolt.Node();\n\nmesh.start();\n````\n\nAnd then you can do things like this in one process:\n\n````javascript\nmesh.emit('hello');\n````\n\n...and in another process:\n\n````javascript\nmesh.on('hello', function(){\n  console.log('world');\n});\n````\n\nI'm working on getting more functionality in the examples folder, but those there should still prove useful.\n\n## philosophy\n\n**bolt**'s main functionality lies in its Node class. Each instance of a Node can send and receive events.\n\nEach Node connects to a Redis server and opens two connections, an incoming subscription channel, and an outgoing publish and command channel.\n\nWhen instantiating a single Node, it is convention to name it `mesh`, reinforcing the paradigm of interconnected Nodes.\n\nIt is possible to instantiate an army of Nodes from a single process, only limited by your open file limit (`ulimit -a`) and Redis's maxconn setting.\n\nIf you would like to share events with the browser, it is preferable to use **bolt.js**, though you can also hijack the socket.io stream from **bolt-monitor** if you're feeling hackish.\n\n## methods\n\n### var node = new bolt.Node(options)\n\n`options` defaults to:\n\n````javascript\n{\n  host: '127.0.0.1',\n  port: 6357,\n  debug: false,\n  silent: false,\n  auth: undefined\n}\n````\n\n### node.start()\n\nCreate incoming and outgoing Redis connections, open the floodgates for events.\n\nIt is customary to define event listeners before calling this method.\n\n### node.emit(hook, data)\n\nEmit an event to all nodes in the mesh, with JSON, string or integer as data.\n\n### node.on(hook, callback)\n\nWatch for an event from self or the mesh. You can get the data from callback(data)\n\nYou can provide an error handler for Bolt to prevent it from throwing:\n\n````javascript\nmesh.on('error', function (e) {\n  console.log(e);\n});\n````\n\n## license\n\n(The MIT License)\n\nCopyright (c) 2011 Cam Pedersen \u003ccam@onswipe.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecto%2Fbolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecto%2Fbolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecto%2Fbolt/lists"}