{"id":22608942,"url":"https://github.com/bitfinexcom/bfx-api-node-plugin-wd","last_synced_at":"2025-04-11T06:14:59.186Z","repository":{"id":57189575,"uuid":"145868746","full_name":"bitfinexcom/bfx-api-node-plugin-wd","owner":"bitfinexcom","description":null,"archived":false,"fork":false,"pushed_at":"2020-06-09T11:06:07.000Z","size":32,"stargazers_count":2,"open_issues_count":2,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-11T06:14:53.975Z","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/bitfinexcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-23T14:56:26.000Z","updated_at":"2021-05-19T04:53:50.000Z","dependencies_parsed_at":"2022-09-15T06:22:10.090Z","dependency_job_id":null,"html_url":"https://github.com/bitfinexcom/bfx-api-node-plugin-wd","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-api-node-plugin-wd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-api-node-plugin-wd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-api-node-plugin-wd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-api-node-plugin-wd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfinexcom","download_url":"https://codeload.github.com/bitfinexcom/bfx-api-node-plugin-wd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351393,"owners_count":21089272,"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-08T15:10:10.262Z","updated_at":"2025-04-11T06:14:59.151Z","avatar_url":"https://github.com/bitfinexcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitfinex Packet Watch-dog Plugin for the Node.JS API\n\n[![Build Status](https://travis-ci.org/bitfinexcom/bfx-api-node-plugin-wd.svg?branch=master)](https://travis-ci.org/bitfinexcom/bfx-api-node-plugin-wd)\n\nThis plugin implements a watch-dog for the Bitfinex Node API. It can be initialized with a reconnection \u0026 watch dog delay, and will close the socket connection \u0026 automatically reconnect if no message arrives within the WD delay. It is meant to be used to detect and cycle stale socket connections.\n\n### Features\n\n* Closes \u0026 re-opens connections if no packet arrives within the configured WD window\n\n### Installation\n\n```bash\nnpm i --save bfx-api-node-plugin-wd\n```\n\n### Quickstart \u0026 Example\n```js\nconst debug = require('debug')('bfx:api:plugins:wd:example')\nconst { Manager, subscribe } = require('bfx-api-node-core')\nconst WDPlugin = require('bfx-api-node-plugin-wd')\n\nconst mgr = new Manager({\n  transform: true,\n\n  // include watch-dog plugin on manager init\n  plugins: [WDPlugin({\n    autoReconnect: true,  // if false, the connection will only be closed\n    reconnectDelay: 5000, // wait 5 seconds before reconnecting\n    packetWDDelay: 10000  // set the watch-dog to a 10s delay\n  })]\n})\n\n// Note that we do nothing here; the watch-dog will fire due to a lack of\n// incoming messages\nmgr.onWS('open', {}, (state = {}) =\u003e {\n  debug('open')\n})\n\nmgr.openWS()\n```\n\n### Docs\n\nFor an executable example, [see `examples/usage.js`](/examples/usage.js)\n\n### Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-api-node-plugin-wd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfinexcom%2Fbfx-api-node-plugin-wd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-api-node-plugin-wd/lists"}