{"id":26281152,"url":"https://github.com/williscool/simple-node-socket.io-wrapper","last_synced_at":"2025-03-14T15:19:39.442Z","repository":{"id":140396588,"uuid":"1549996","full_name":"williscool/simple-node-socket.io-wrapper","owner":"williscool","description":"Makes using the node.js socket.io server a bit less painful","archived":false,"fork":false,"pushed_at":"2011-04-04T05:49:51.000Z","size":92,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-11T21:07:20.194Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/williscool.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-03-31T08:08:11.000Z","updated_at":"2023-03-11T21:11:42.101Z","dependencies_parsed_at":"2023-03-11T21:11:42.053Z","dependency_job_id":null,"html_url":"https://github.com/williscool/simple-node-socket.io-wrapper","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williscool%2Fsimple-node-socket.io-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williscool%2Fsimple-node-socket.io-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williscool%2Fsimple-node-socket.io-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williscool%2Fsimple-node-socket.io-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/williscool","download_url":"https://codeload.github.com/williscool/simple-node-socket.io-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243597798,"owners_count":20316845,"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":"2025-03-14T15:19:38.937Z","updated_at":"2025-03-14T15:19:39.430Z","avatar_url":"https://github.com/williscool.png","language":"JavaScript","readme":"# Simple Node Socket.io Wrapper\n\n    var express = require('express');\n    var app = express.createServer();\n    app.use(express.bodyParser());\n\n    var sockH = require('../lib/node-socket-wrapper').config(app);\n\n    app.listen(5000);\n\n    app.get(\"/\", function (req, res){\n    \n         sockH.on('gotClient', function(seh){\n           \n            seh.greeting('hi there client. this is a bit easier to write');\n            setTimeout( seh.calling('im caliing you!'), 5000);\n            seh._trigger('anEventIMadeUp', 'A message I would like to send' );\n            seh._trigger('passingData', req.body.somethingOrOther );\n\n         });\n\n    });\n \n\n## How it works\n\n1) It binds to any connect server (in the example an express one) \n\n2) Returns a socket bound to the port of your server  \n\n3) on the `gotClient` event it returns the client that has connected with helpful functions wrapped around it that you can extend\n\n\n## This allows you to\n\na) leave socket.io connection code out of your app code.\n\nb) easily access actual clients\n\nc) trivially use socket.io on more than one page in an app.\n\n\n## Usage\n\nthere is server example in this repository to help you get started\n\n\n## Credits\n\nparts of the server code inspired by this article\n\n[http://spiritconsulting.com.ar/fedex/2010/11/events-with-jquery-nodejs-and-socket-io/](http://spiritconsulting.com.ar/fedex/2010/11/events-with-jquery-nodejs-and-socket-io/)\n\nserver depend on [`express`](http://expressjs.com).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliscool%2Fsimple-node-socket.io-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliscool%2Fsimple-node-socket.io-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliscool%2Fsimple-node-socket.io-wrapper/lists"}