{"id":22394168,"url":"https://github.com/atlantis-software/telepathymq","last_synced_at":"2025-03-26T22:41:17.675Z","repository":{"id":55476165,"uuid":"107646301","full_name":"Atlantis-Software/telepathymq","owner":"Atlantis-Software","description":"ipc for node","archived":false,"fork":false,"pushed_at":"2021-10-07T13:28:05.000Z","size":31,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T04:25:25.614Z","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/Atlantis-Software.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":"2017-10-20T07:29:31.000Z","updated_at":"2021-10-07T13:28:15.000Z","dependencies_parsed_at":"2022-08-15T01:10:48.789Z","dependency_job_id":null,"html_url":"https://github.com/Atlantis-Software/telepathymq","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/Atlantis-Software%2Ftelepathymq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atlantis-Software%2Ftelepathymq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atlantis-Software%2Ftelepathymq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atlantis-Software%2Ftelepathymq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Atlantis-Software","download_url":"https://codeload.github.com/Atlantis-Software/telepathymq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245749796,"owners_count":20666084,"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-05T05:09:17.755Z","updated_at":"2025-03-26T22:41:17.654Z","avatar_url":"https://github.com/Atlantis-Software.png","language":"JavaScript","readme":"# telepathymq\n\na nodejs module for inter-process communication that let you share javascript  object and events over network that support tcp and secure tls sockets.\n\n[![npm version](https://badge.fury.io/js/telepathymq.svg)](https://www.npmjs.com/telepathymq)\n[![Build Status](https://travis-ci.org/Atlantis-Software/telepathymq.svg?branch=master)](https://travis-ci.org/Atlantis-Software/telepathymq)\n[![Coverage Status](https://coveralls.io/repos/github/Atlantis-Software/telepathymq/badge.svg?branch=master)](https://coveralls.io/github/Atlantis-Software/telepathymq?branch=master)\n[![Dependencies Status](https://david-dm.org/Atlantis-Software/telepathymq.svg)](https://david-dm.org/Atlantis-Software/telepathymq)\n\n## Installation\ntelepathymq is available over npm\n```\nnpm install telepathymq\n```\n\n## Sample\n\nthis code initialise connection between client and server side and send an \"hello world\" message\n```\nvar Telepathy = require('telepathymq');\n\n// initialise the server side\n// the constructor take a string argument for the instance identity\n// used to send data from other node.\n// it must be uniq on connected nodes.\nvar server = new Telepathy('server');\nserver.listen(8060, function() {\n  console.log('server is listening on port 8060');\n});\nserver.on('register', function(identity) {\n  console.log(identity + ' has registered on server');\n});\nserver.on('message', function(msg) {\n  console.log('message: ' + msg);\n});\n\n// initialise the client side\nvar client = new Telepathy('client');\nclient.register('server', 'tcp://localhost:8060');\nclient.on('register', function(identity) {\n  console.log(identity + ' has registered on client');\n  // emit an event called 'message' on 'server' with a string 'hello world' as data\n  client.emit('server', 'message', 'hello world');\n});\n```\n\n## Methods\n\n### server.listen()\nStart a server listening for connections.\nPossible signatures:\n* listen(port, [ip,] callback) \n* listen(url, options, callback)\n\n### server.listen(port, [ip,] callback) \nport: integer tcp port number\nip: string ip address (optional, default: '0.0.0.0')\ncallback: function\n\n### server.listen(connectString, [options,] callback)\nconnectString: string {tcp | tls}://{ip | hostname}:{port}\noptions: object [see node tls.createServer options](https://nodejs.org/api/tls.html) only use in tls protocol\ncallback: function\n\n### client.register(identity, connectString, [options,] callback)\nimmediately initiates connection.\nWhen the connection is established, a `'register'` event will be emitted on the client.\n\nidentity: string identity of server node\nconnectString: string {tcp | tls}://{ip | hostname}:{port}\noptions: object [see node tls.connect options](https://nodejs.org/api/tls.html) only use in tls protocol\ncallback: function\n\n### node.emit(identity, eventName, data)\nemit an event on identity node.\n\nidentity: string identity of the other side node.\neventName: string the name of the event being emited\ndata: string,object data being sent over event\n\n### node.on(eventName, listener)\nAdds the `listener` function to the end of the listeners array for the event named `eventName`.\n\neventName: string the name of the event.\nlistener: function\n\n### node.defer(identity, eventName[, data])\nreturn an [asynk](https://www.npmjs.com/package/asynk) promise and send an asynk deferred.\n\nidentity: string identity of the other side node.\neventName: string the name of the event being emited\ndata: string,object data being sent over event\n\n```\nserver.on('myDefer', function(defer, data) {\n  if (data.val === 1) {\n    defer.notify('some data');\n  }\n});\n\nvar promise = client.defer('server', 'myDefer', {val: 1});\npromise.progress(function(data) {\n  console.log(data);\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatlantis-software%2Ftelepathymq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatlantis-software%2Ftelepathymq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatlantis-software%2Ftelepathymq/lists"}