{"id":16707376,"url":"https://github.com/xiaodaigh/promisewebsocket","last_synced_at":"2025-03-14T16:39:07.946Z","repository":{"id":73048599,"uuid":"100424786","full_name":"xiaodaigh/PromiseWebsocket","owner":"xiaodaigh","description":"A simple extension of the Websocket object by making the .send method into a Promise","archived":false,"fork":false,"pushed_at":"2017-08-15T22:48:53.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T10:08:20.857Z","etag":null,"topics":["javascript","promise","websocket"],"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/xiaodaigh.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-08-15T22:35:55.000Z","updated_at":"2017-08-15T22:49:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"5fe24321-1e2b-4873-a0ca-c650029b4502","html_url":"https://github.com/xiaodaigh/PromiseWebsocket","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/xiaodaigh%2FPromiseWebsocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaodaigh%2FPromiseWebsocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaodaigh%2FPromiseWebsocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaodaigh%2FPromiseWebsocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaodaigh","download_url":"https://codeload.github.com/xiaodaigh/PromiseWebsocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243613113,"owners_count":20319467,"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":["javascript","promise","websocket"],"created_at":"2024-10-12T19:39:10.225Z","updated_at":"2025-03-14T16:39:07.921Z","avatar_url":"https://github.com/xiaodaigh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PromiseWebsocket\nA simple extension of the Websocket object by making the .send method into a Promise\n\n# Usage\n```javascript\nvar pws = new PromiseWebsocket(url)\npws.onmessage = () =\u003e {\n\tconsole.log('onmessage trigger');\n\treturn \"something\"\n}\n\npws.send(something)\t\n\t.then((success_obj) =\u003e {\n\t\t//this will execute when onmessage gets triggered\n\t\t// success_obj.msg this is the message sent to onmessage\n\t\tconsole.log(success_obj.msg)\n\t\t// if you have set .onmessage method then it returns the onmessage's returned output\n\t\t// otherwise it's null\n\t\tconsole.log(success_obj.onmessage_return)\n\t})\n\t.catch({\n\t\t//this will trigger if the .onerror method gets triggered\n\t\tconsole.log(\"onerror was triggered\")\n\t})\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaodaigh%2Fpromisewebsocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaodaigh%2Fpromisewebsocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaodaigh%2Fpromisewebsocket/lists"}