{"id":20562176,"url":"https://github.com/spinda/ws-pacemaker","last_synced_at":"2026-05-16T01:34:25.416Z","repository":{"id":44075219,"uuid":"206890213","full_name":"spinda/ws-pacemaker","owner":"spinda","description":"💗 Drop-in WebSocket ping/pong heartbeat handling for Node.js","archived":false,"fork":false,"pushed_at":"2023-01-04T21:59:39.000Z","size":435,"stargazers_count":2,"open_issues_count":13,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T19:33:51.709Z","etag":null,"topics":["heartbeat","javascript","nodejs","websocket"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spinda.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":"2019-09-06T23:50:41.000Z","updated_at":"2025-03-21T05:40:52.000Z","dependencies_parsed_at":"2023-02-02T21:17:03.538Z","dependency_job_id":null,"html_url":"https://github.com/spinda/ws-pacemaker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/spinda/ws-pacemaker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinda%2Fws-pacemaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinda%2Fws-pacemaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinda%2Fws-pacemaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinda%2Fws-pacemaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spinda","download_url":"https://codeload.github.com/spinda/ws-pacemaker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinda%2Fws-pacemaker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271469227,"owners_count":24765124,"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-08-21T02:00:08.990Z","response_time":74,"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":["heartbeat","javascript","nodejs","websocket"],"created_at":"2024-11-16T04:09:30.528Z","updated_at":"2026-05-16T01:34:20.398Z","avatar_url":"https://github.com/spinda.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ws-pacemaker\n\n\u003e Drop-in WebSocket ping/pong heartbeat handling for the [ws](https://github.com/websockets/ws)\n\u003e Node.js module\n\n[![npm](https://img.shields.io/npm/v/ws-pacemaker)](https://npmjs.com/package/ws-pacemaker)\n[![Build Status](https://img.shields.io/travis/spinda/ws-pacemaker/master)](https://travis-ci.org/spinda/ws-pacemaker)\n\n## Overview\n\nThis module wraps around a\n[`WebSocket.Server`](https://github.com/websockets/ws/blob/master/doc/ws.md#class-websocketserver)\nto send periodic heartbeat pings (via\n[`WebSocket#ping`](https://github.com/websockets/ws/blob/master/doc/ws.md#websocketpingdata-mask-callback))\nto all connected clients,\nand closes connections when a corresponding pong is not received (via\n[`WebSocket#'pong'`](https://github.com/websockets/ws/blob/master/doc/ws.md#event-pong)) within an\nacceptable timeout.\n\n```js\n'use strict';\n\nconst WebSocket = require('ws');\nconst Pacemaker = require('ws-pacemaker');\n \nconst server = new WebSocket.Server({ port: 8080 });\n\nconst pacemaker = new Pacemaker(server, {\n  pingInterval: Pacemaker.defaultPingInterval,\n  // ^ optional - default: send a ping every 25000 ms\n  pongTimeout: Pacemaker.defaultPongTimeout,\n  // ^ optional - default: terminate connections after 60000 ms without a pong\n});\n\npacemaker.start();\n\n//pacemaker.stop();\n// ^ automatically called when the server closes\n```\n\n## Development\n\n### Dependency Management\n\n[Yarn](https://yarnpkg.com) is recommended for managing dependencies and development tooling.\n\n### Code Formatting\n\nCode formatting is handled by [prettierx](https://github.com/brodybits/prettierx), with a few\n[options](.prettierrc.toml) tweaked.\n\nTo check that the code is correctly formatted:\n\n```\nyarn run check\n```\n\nTo auto-format the code:\n\n```\nyarn run fmt\n```\n\n### Testing\n\nThis project uses [Jest](https://jestjs.io/) as its test framework.\n\nTo run all tests:\n\n```\nyarn run test\n```\n\n## License\n\nCopyright (C) 2019-2020 Michael Smith \u0026lt;michael@spinda.net\u0026gt;\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the\nMozilla Public License, version 2.0.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\neven the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Mozilla\nPublic License for more details.\n\nYou should have received a [copy](LICENSE) of the Mozilla Public License along with this program.\nIf not, see [https://www.mozilla.org/en-US/MPL/2.0/](https://www.mozilla.org/en-US/MPL/2.0/).\n\nHelpful resources:\n\n- [Mozilla's MPL-2.0 FAQ](https://www.mozilla.org/en-US/MPL/2.0/FAQ/)\n- [MPL-2.0 on TLDRLegal](https://tldrlegal.com/license/mozilla-public-license-2.0-\\(mpl-2\\))\n\n#### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in\nthis work by you shall be licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinda%2Fws-pacemaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspinda%2Fws-pacemaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinda%2Fws-pacemaker/lists"}