{"id":15561861,"url":"https://github.com/doodzik/plain-tcp","last_synced_at":"2025-04-23T22:54:37.867Z","repository":{"id":57325496,"uuid":"46264787","full_name":"doodzik/plain-tcp","owner":"doodzik","description":"a very simple tcp server and client build with frp-middleware","archived":false,"fork":false,"pushed_at":"2015-11-16T23:04:15.000Z","size":23,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T22:54:33.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doodzik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-11-16T09:28:58.000Z","updated_at":"2022-02-05T21:24:03.000Z","dependencies_parsed_at":"2022-09-09T08:52:10.657Z","dependency_job_id":null,"html_url":"https://github.com/doodzik/plain-tcp","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/doodzik%2Fplain-tcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doodzik%2Fplain-tcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doodzik%2Fplain-tcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doodzik%2Fplain-tcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doodzik","download_url":"https://codeload.github.com/doodzik/plain-tcp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528700,"owners_count":21445511,"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-02T16:10:30.818Z","updated_at":"2025-04-23T22:54:37.847Z","avatar_url":"https://github.com/doodzik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# plain-tcp\n[![Build Status](https://travis-ci.org/doodzik/plain-tcp.svg?branch=master)](https://travis-ci.org/doodzik/plain-tcp)\n\nA very simple tcp server and client build with frp-middleware\n\nCheck out the full API over at the [frp-middleware](http://github.com/doodzik/frp-middleware) repo.\n\n# Installation\n\n```bash\n$ npm install plain-tcp --save\n```\n# Usage\n\n```javascript\nimport assert             from 'assert'\nimport { Server, Client } from 'plain-tcp'\n\nlet server = new Server(5442)\nserver\n.map(data =\u003e { \n  assert(data === 'hello')\n  return 'world'\n})\n.subscribe()\n\nlet client = new Client(5442) \nclient.emit('hello', data =\u003e {  \n  assert(data === 'world') \n}) \n```\n\n# API\n\n### \\#emit(String) \nSends a message to the Server. Without handling the response.\n\n### \\#emit(String, function)\nSends a message to the Server and calls the provided function with the response.\n\n### \\#subscribe()\nStarts listening on the port.\nIf a map returns an empty value the server doesn't respond to the client.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoodzik%2Fplain-tcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoodzik%2Fplain-tcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoodzik%2Fplain-tcp/lists"}