{"id":25566516,"url":"https://github.com/pdmlab/net-retry-connect","last_synced_at":"2026-03-16T08:30:17.007Z","repository":{"id":57310227,"uuid":"52473009","full_name":"PDMLab/net-retry-connect","owner":"PDMLab","description":"Attempt to connect to net Sockets using retry patterns","archived":false,"fork":false,"pushed_at":"2016-02-29T07:04:25.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T19:03:50.823Z","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PDMLab.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":"2016-02-24T20:42:25.000Z","updated_at":"2017-12-19T21:09:57.000Z","dependencies_parsed_at":"2022-09-09T21:20:48.961Z","dependency_job_id":null,"html_url":"https://github.com/PDMLab/net-retry-connect","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/PDMLab%2Fnet-retry-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDMLab%2Fnet-retry-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDMLab%2Fnet-retry-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDMLab%2Fnet-retry-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PDMLab","download_url":"https://codeload.github.com/PDMLab/net-retry-connect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239927230,"owners_count":19719826,"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":"2025-02-20T22:33:00.034Z","updated_at":"2026-03-16T08:30:16.949Z","avatar_url":"https://github.com/PDMLab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# net-retry-connect\nAttempt to connect to net Sockets using retry patterns.\n\n```net-retry-connect``` is based on the Node.js ```net``` module as well as the [retry](https://www.npmjs.com/package/retry) module.\n\n## Installation\n\n```npm install net-retry-connect --save```\n\n\n## API\n\n### retryConnect.to(options, callback)\n\n```options``` provides this options:\n* ```port```: the TCP port\n* ```host```: optional, defaults to ```'localhost'```\n* ```retryOptions```, optional, see retry options for [retry.operation](https://github.com/tim-kos/node-retry#retryoperationoptions)\n\n```callback``` returns a client object if connection has been successful. Otherwise it returns the error.\n\n```js\nvar retryConnect = require('net-retry-connect');\nretryConnect.to({port: 3000, host: 'localhost'}, function (error, client) {\n    // use the client\n});\n```\n\n#### Usage of retryOptions\n\n```js\nvar retryConnect = require('net-retry-connect');\n\n// retry for 2 seconds only\nvar retryOptions = {\n  retries: 2,\n  factor: 1\n};\n\nretryConnect.to({port: 3000, host: 'localhost', retryOptions: retryOptions }, function (error, client) {\n    // use the client\n});\n```\n\n## Running the tests:\n\n```\nnpm install   \nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdmlab%2Fnet-retry-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdmlab%2Fnet-retry-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdmlab%2Fnet-retry-connect/lists"}