{"id":13624397,"url":"https://github.com/NodeFly/uhura","last_synced_at":"2025-04-16T00:32:19.073Z","repository":{"id":8485892,"uuid":"10090312","full_name":"NodeFly/uhura","owner":"NodeFly","description":"Server-to-server event emitter with session support","archived":false,"fork":false,"pushed_at":"2014-02-11T17:53:55.000Z","size":603,"stargazers_count":18,"open_issues_count":5,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-01T22:17:39.684Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NodeFly.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":"2013-05-15T23:55:43.000Z","updated_at":"2025-01-02T01:12:18.000Z","dependencies_parsed_at":"2022-09-07T13:00:56.127Z","dependency_job_id":null,"html_url":"https://github.com/NodeFly/uhura","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeFly%2Fuhura","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeFly%2Fuhura/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeFly%2Fuhura/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeFly%2Fuhura/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NodeFly","download_url":"https://codeload.github.com/NodeFly/uhura/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248605205,"owners_count":21132127,"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-08-01T21:01:42.089Z","updated_at":"2025-04-16T00:32:18.852Z","avatar_url":"https://github.com/NodeFly.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Uhura\n[![Build Status](https://travis-ci.org/NodeFly/uhura.png)](https://travis-ci.org/NodeFly/uhura)\n\nUhura is a server-to-server event emitter wire protocol. It provides a shared event emitter and data store between a server and client, with automatic reconnection and exponential backoff logic.\n\n## Install\n\n    npm install uhura\n\n## Usage\n    \n    var server = Uhura.createServer(function (client) {\n      client.on('ping', function () {\n        client.send('pong')\n      })\n    })\n    server.listen(5555)\n\n    var client = Uhura.createClient(5555)\n    client.on('pong', function () {\n      console.log('pong received')\n    })\n    client.send('ping')\n\n## API\n\n### Uhura.createServer(port, cb)\nCreates a net server that uses an event emitter to communicate. Callback receives a unique emitter for the net socket.\n\n### Uhura.createClient(port [, host] [, cb]) returns client emitter\nCreate a client emitter. The port argument may be a number, a string, or an existing net.connect() instance. It also attaches a few extra methods, as seen below.\n\n### client.reconnect()\nForcefully destroys the socket and reconnects.\n\n### client.autoReconnect()\nFlag the client to automatically reconnect, which an exponential backoff mechanism.\n\n### client.disconnect()\nDisable auto-reconnection, if enabled, and closes the socket.\n\n### client.send(event [, args...])\nThis is identical to the interface for the emit() function seen on normal event emitters, except it sends to the remote server.\n\n### client.set(key, val)\nSets a value in the shared data store. This is also used to store session id for reconnection.\n\n### client.get(key)\nGets a value from the shared data store.\n\n---\n\n### Copyright (c) 2013 NodeFly\n#### Licensed under MIT License\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.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNodeFly%2Fuhura","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNodeFly%2Fuhura","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNodeFly%2Fuhura/lists"}