{"id":18609380,"url":"https://github.com/bcoin-org/bsock","last_synced_at":"2025-04-10T22:31:07.043Z","repository":{"id":57190581,"uuid":"107434750","full_name":"bcoin-org/bsock","owner":"bcoin-org","description":"Minimal implementation of the socket.io protocol.","archived":false,"fork":false,"pushed_at":"2023-10-31T09:17:45.000Z","size":390,"stargazers_count":9,"open_issues_count":2,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-25T05:41:30.195Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcoin-org.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-18T16:32:26.000Z","updated_at":"2024-04-22T14:04:20.000Z","dependencies_parsed_at":"2024-06-18T17:08:21.948Z","dependency_job_id":"7ba7c52c-c737-4585-9b09-ae5f07643571","html_url":"https://github.com/bcoin-org/bsock","commit_stats":{"total_commits":87,"total_committers":5,"mean_commits":17.4,"dds":"0.10344827586206895","last_synced_commit":"4a580bb7b963c5886af256260eb406f719adb86e"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcoin-org%2Fbsock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcoin-org%2Fbsock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcoin-org%2Fbsock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcoin-org%2Fbsock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcoin-org","download_url":"https://codeload.github.com/bcoin-org/bsock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248309482,"owners_count":21082220,"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-11-07T03:05:59.028Z","updated_at":"2025-04-10T22:31:06.509Z","avatar_url":"https://github.com/bcoin-org.png","language":"JavaScript","readme":"# bsock\n\nA minimal websocket-only implementation of the socket.io protocol, complete\nwith ES6/ES7 features.\n\n## Usage\n\n``` js\nconst http = require('http');\nconst bsock = require('bsock');\nconst io = bsock.createServer();\nconst server = http.createServer();\n\nio.attach(server);\n\nio.on('socket', (socket) =\u003e {\n  // Bind = listen for event\n  socket.bind('bar', (data) =\u003e {\n    console.log('Received bar: %s.', data.toString('ascii'));\n  });\n  // Hook = listen for call (event + ack)\n  socket.hook('foo', async () =\u003e {\n    return Buffer.from('bar');\n  });\n});\n\nserver.listen(8000);\n\nconst socket = bsock.connect(8000);\n\nsocket.on('connect', async () =\u003e {\n  console.log('Calling foo...');\n  // Call = emit event and wait for ack\n  const data = await socket.call('foo');\n  console.log('Response for foo: %s.', data.toString('ascii'));\n  console.log('Sending bar...');\n  // Fire = emit event\n  socket.fire('bar', Buffer.from('baz'));\n});\n```\n\n## Contribution and License Agreement\n\nIf you contribute code to this project, you are implicitly allowing your code\nto be distributed under the MIT license. You are also implicitly verifying that\nall code is your original work. `\u003c/legalese\u003e`\n\n## License\n\n- Copyright (c) 2017, Christopher Jeffrey (MIT License).\n\nSee LICENSE for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcoin-org%2Fbsock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcoin-org%2Fbsock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcoin-org%2Fbsock/lists"}