{"id":22727275,"url":"https://github.com/noviel/osnova-module-socket.io","last_synced_at":"2025-08-09T05:27:18.559Z","repository":{"id":57316579,"uuid":"81835508","full_name":"Noviel/osnova-module-socket.io","owner":"Noviel","description":"Osnova socket.io module","archived":false,"fork":false,"pushed_at":"2017-02-13T17:39:03.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T18:18:47.977Z","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/Noviel.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":"2017-02-13T14:47:40.000Z","updated_at":"2017-02-13T14:50:59.000Z","dependencies_parsed_at":"2022-08-25T20:31:59.810Z","dependency_job_id":null,"html_url":"https://github.com/Noviel/osnova-module-socket.io","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/Noviel%2Fosnova-module-socket.io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noviel%2Fosnova-module-socket.io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noviel%2Fosnova-module-socket.io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noviel%2Fosnova-module-socket.io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Noviel","download_url":"https://codeload.github.com/Noviel/osnova-module-socket.io/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246260478,"owners_count":20748861,"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-10T17:11:35.644Z","updated_at":"2025-03-30T00:23:44.965Z","avatar_url":"https://github.com/Noviel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Osnova Socket.IO module\n\n## bI?\n\nBasic Socket.IO wrapper exported as osnova module.\n\n## Install\n```sh\nnpm i osnova-module-socket.io\n```\n## Usage\n\n```javascript\nimport OSNOVA from 'osnova';\nimport socketIoModule from 'osnova-module-socket.io';\n\nconst osnova = OSNOVA({\n  modules: [ socketIoModule(/* optional options object */) ],\n  \n  /* rest OSNOVA config */\n\n});\n\n```\n\nTakes optional `opts` object as a parameter with properties:\n- **http** { object } extern http server, if `undefined` will be used `osnova.http`.\n- **middlewares** { array } - Socket.IO middlewares list.\n\nExports to osnova `io` object with interface:\n- **native()** { function } return inner Socket.IO object.\n- **on(eventName, callback)** { function } - add an event for connected sockets. \nCallback will \nbe called with `(socket, payload)` parameters when socket \ntriggers an event.\n\n### Passing Socket.IO middlewares\n\nMiddlewares should have signature `osnova =\u003e middleware`. \n\n```javascript\nconst myMiddleware = (osnova) =\u003e (socket, next) =\u003e {\n console.log(`Hey, i have access to OSNOVA version ${osnova.__version} here!`);\n next();\n}\n\nsocketIoModule({\n  middlewares: [myMiddleware]\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoviel%2Fosnova-module-socket.io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoviel%2Fosnova-module-socket.io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoviel%2Fosnova-module-socket.io/lists"}