{"id":17944806,"url":"https://github.com/ktanakaj/simple-ng-websocket","last_synced_at":"2025-09-14T06:06:10.322Z","repository":{"id":17776971,"uuid":"82689696","full_name":"ktanakaj/simple-ng-websocket","owner":"ktanakaj","description":"Simple WebSocket client for Angular","archived":false,"fork":false,"pushed_at":"2024-01-10T06:41:13.000Z","size":2396,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-01T21:46:54.580Z","etag":null,"topics":["angular","npm-package","websocket-client"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ktanakaj.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-02-21T14:34:45.000Z","updated_at":"2022-11-20T08:53:15.000Z","dependencies_parsed_at":"2024-10-29T06:15:30.613Z","dependency_job_id":null,"html_url":"https://github.com/ktanakaj/simple-ng-websocket","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":"0.22580645161290325","last_synced_commit":"de75c197595b0d24e20d6dc5ea1a4e06674819b6"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/ktanakaj/simple-ng-websocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktanakaj%2Fsimple-ng-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktanakaj%2Fsimple-ng-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktanakaj%2Fsimple-ng-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktanakaj%2Fsimple-ng-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktanakaj","download_url":"https://codeload.github.com/ktanakaj/simple-ng-websocket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktanakaj%2Fsimple-ng-websocket/sbom","scorecard":{"id":571933,"data":{"date":"2025-08-11","repo":{"name":"github.com/ktanakaj/simple-ng-websocket","commit":"cabdc3ec5da675522e2007fc2a0b3172d989223d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/ktanakaj/simple-ng-websocket/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/ktanakaj/simple-ng-websocket/test.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/test.yml:19","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"41 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-hpx4-r86g-5jrg","Warn: Project is vulnerable to: GHSA-prr3-c3m5-p7q2","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-4www-5p9h-95mh","Warn: Project is vulnerable to: GHSA-9gqv-wp59-fq42","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T16:34:04.084Z","repository_id":17776971,"created_at":"2025-08-20T16:34:04.084Z","updated_at":"2025-08-20T16:34:04.084Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275067210,"owners_count":25399649,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["angular","npm-package","websocket-client"],"created_at":"2024-10-29T06:05:09.614Z","updated_at":"2025-09-14T06:06:10.286Z","avatar_url":"https://github.com/ktanakaj.png","language":"TypeScript","readme":"# simple-ng-websocket\n[![NPM](https://nodei.co/npm/simple-ng-websocket.png?downloads=true)](https://nodei.co/npm/simple-ng-websocket/)\n[![Test](https://github.com/ktanakaj/simple-ng-websocket/actions/workflows/test.yml/badge.svg)](https://github.com/ktanakaj/simple-ng-websocket/actions/workflows/test.yml)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)\n\nThis is simple WebSocket client for [Angular](https://angular.io/). simple-ng-websocket is thin wrapper at Browser's [WebSocket](https://developer.mozilla.org/en/docs/Web/API/WebSocket).\n\n## Install\nTo install simple-ng-websocket in the current directory, run:\n\n    npm install simple-ng-websocket\n\n## Usage\nsimple-ng-websocket can be use to Angular provider.\n\nFirst, you must define it in the providers.\n\n    import { NgModule } from '@angular/core';\n    import { SimpleNgWebSocket, CONNECT_URL, LOGGER } from 'simple-ng-websocket';\n\n    @NgModule({\n    \tproviders: [\n    \t\t{ provide: CONNECT_URL, useValue: 'ws://' + window.location.host + '/ws/' },\n    \t\t{ provide: LOGGER, useValue: (level, message) =\u003e console.log(message) },\n    \t\tSimpleNgWebSocket,\n    \t],\n    })\n    export class AppModule { }\n\nYou can inject `CONNECT_URL` and `LOGGER` parameters.\n\n* `CONNECT_URL` : The URL to which to connect. If `CONNECT_URL` is not specified, the client connect to `'ws://' + window.location.host + '/'` or `'wss://' + window.location.host + '/'`.\n* `LOGGER` : The logger for this client's log event such as OPEN, CLOSE, SEND, RECEIVE and ERROR.\n\nThen, you can use it on your logic code.\n\n    import { Injectable } from '@angular/core';\n    import { SimpleNgWebSocket } from 'simple-ng-websocket';\n\n    @Injectable()\n    export class SampleService {\n    \tconstructor(private ngws: SimpleNgWebSocket) {\n    \t\tthis.ngws.on('message', (msg) =\u003e {\n    \t\t\tconsole.log(msg);\n    \t\t});\n    \t}\n\n    \tsendMessage(msg: string): void {\n    \t\tthis.ngws.send(msg);\n    \t}\n    }\n\n## API\n\n### Class: SimpleNgWebSocket\n#### new SimpleNgWebSocket([url, logger])\n* `url` {String} It is the same as `CONNECT_URL`.\n* `logger` {Function} It is the same as `LOGGER`.\n\nCreate a new websocket connection. The constructor call `connect()` automatically.\n\n#### Event: 'open'\n* `ev` {Event}\n* `ngws` {SimpleNgWebSocket}\n\nEmitted when the handshake is complete. `ev` is through from Browser's `WebSocket`.\n\n#### Event: 'message'\n* `ev` {MessageEvent}\n* `ngws` {SimpleNgWebSocket}\n\nEmitted when a message is received from the server. `ev` is through from Browser's `WebSocket`.\n\n#### Event: 'close'\n* `ev` {CloseEvent}\n* `ngws` {SimpleNgWebSocket}\n\nEmitted when the connection is closed. `ev` is through from Browser's `WebSocket`.\n\n#### Event: 'error'\n* `ev` {ErrorEvent}\n* `ngws` {SimpleNgWebSocket}\n\nEmitted when an error occurs. `ev` is through from Browser's `WebSocket`.\n\n#### ngws.connect()\nOpen a new websocket connection.\n\n#### ngws.close()\n* `code` {Number} A numeric value indicating the status code explaining why the connection is being closed.\n* `reason` {String} A human-readable string explaining why the connection is closing.\n\nClose the websocket connection.\n\n#### ngws.send(message[, toJson])\n* `message` {String} The data to send to the server.\n* `toJson` {Boolean} Specifies whether message should be `JSON.stringify()` or not. Defaults to true.\n\nSends `message` through the connection. If the connection was not opend, `send()` call `connect()` automatically.\n\n#### ngws.url\n* {String}\n\nThe URL of the WebSocket server.\n\n#### ngws.ws\n* {WebSocket}\n\nThe connection instance of the raw `WebSocket`.\n\n## Example\nYou can find a example web application here.\n\n* [ktanakaj/ws-chat-sample](https://github.com/ktanakaj/ws-chat-sample)\n\n## License\n[MIT](https://github.com/ktanakaj/simple-ng-websocket/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktanakaj%2Fsimple-ng-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktanakaj%2Fsimple-ng-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktanakaj%2Fsimple-ng-websocket/lists"}