{"id":18850776,"url":"https://github.com/luqmanoop/pingmydyno","last_synced_at":"2025-04-14T09:41:14.345Z","repository":{"id":34362671,"uuid":"177738360","full_name":"luqmanoop/pingmydyno","owner":"luqmanoop","description":"Keep Heroku dynos awake forever ☕️","archived":false,"fork":false,"pushed_at":"2023-01-03T18:36:42.000Z","size":1744,"stargazers_count":25,"open_issues_count":18,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T22:32:59.171Z","etag":null,"topics":["dyno","heroku","nodejs","ping","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pingmydyno","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/luqmanoop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-26T07:43:28.000Z","updated_at":"2023-03-28T11:59:09.000Z","dependencies_parsed_at":"2023-01-15T06:35:31.579Z","dependency_job_id":null,"html_url":"https://github.com/luqmanoop/pingmydyno","commit_stats":null,"previous_names":["luqmanoop/pingmydyno","codeshifu/pingmydyno"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Fpingmydyno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Fpingmydyno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Fpingmydyno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Fpingmydyno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luqmanoop","download_url":"https://codeload.github.com/luqmanoop/pingmydyno/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855740,"owners_count":21172635,"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":["dyno","heroku","nodejs","ping","typescript"],"created_at":"2024-11-08T03:31:20.034Z","updated_at":"2025-04-14T09:41:14.318Z","avatar_url":"https://github.com/luqmanoop.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\"img/sleeping-dyno.gif\"\u003e\n\t\u003ch1 style=\"font-weight:bold;\"\u003epingmydyno\u003c/h1\u003e\n\t\u003cp\u003e\n\t\t\u003cb\u003eKeep Heroku dynos awake forever ☕️\u003c/b\u003e\n\t\u003c/p\u003e\n    \u003cp\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\"\u003e\n    \u003cimg alt=\"PRs Welcome\" src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\"\u003e\n    \u003ca href=\"#contributors\"\u003e\u003cimg alt=\"GitHub contributors\" src=\"https://img.shields.io/github/contributors/codeshifu/pingmydyno.svg\"\u003e\u003c/a\u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\n## Why?\n\nHeroku (free) dynos are great for hosting apps and showing them off to\nyour boss/friends or potential employer. The downside, however, is that your app\nwill fall asleep 😴 if it doesn't receive any web traffic within a 30-minute\nwindow.\n\n`pingmydyno` solves this by pinging your server periodically so it never falls asleep.\n\n## Features\n\n- Forever dyno pings\n- Automatically retry ping on failure\n\n## Installation\n\n```bash\nnpm install pingmydyno\n\n# or using yarn\n\nyarn add pingmydyno\n```\n\n## Usage\n\nWith Express.js (ES6 module)\n\n```javascript\n...\nimport express from 'express';\nimport pingmydyno from 'pingmydyno';\n\nconst app = express();\n\n...\n\napp.listen(PORT, () =\u003e {\n    pingmydyno('https://myapp.herokuapp.com');\n});\n\n```\n\nWith Hapi.js (commonJS)\n\n```javascript\nconst Hapi = require('hapi');\nconst pingmydyno = require('pingmydyno');\n\nconst server = Hapi.server({ port, host });\n\nasync () =\u003e {\n  await server.start();\n  pingmydyno('https://myapp.herokuapp.com');\n};\n```\n\nWith Koa.js\n\n```javascript\nconst Koa = require('koa');\nconst pingmydyno = require('pingmydyno');\n\nconst app = new Koa();\nconst url = process.env.APP_URL;\n\n...\n\napp.listen(3000).on('listening', () =\u003e {\n    pingmydyno(url, {\n        pingInterval: 60 * 15 * 1000, // ping every 15mins\n        onFailure() {\n            // logger\n        }\n    })\n})\n```\n\n## APIs\n\n**pingmydyno(url, [Config])**\n\n### url\n\nType: `string`\n\nRequired: `yes`\n\n### Config\n\nType: `Object`\n\nRequired: `no`\n\n|              | value                 | default     | description                                          |\n| ------------ | --------------------- | ----------- | ---------------------------------------------------- |\n| pingInterval | number (milliseconds) | 1200000     | interval between the next ping (max = 25mins)        |\n| maxRetry     | number                | 2           | retry times when ping fail                           |\n| onSuccess    | function              | ( ) =\u003e null | callback function called when a ping is successful   |\n| onFailure    | function              | ( ) =\u003e null | callback function called when `maxRetry` ping failed |\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003ctable\u003e\u003ctr\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"https://akhilo.me\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/15332525?v=4\" width=\"100px;\" alt=\"Kizito Akhilome\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKizito Akhilome\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/codeshifu/pingmydyno/commits?author=akhilome\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"https://twitter.com/codeshifu\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/5154605?v=4\" width=\"100px;\" alt=\"Luqman Olushi O.\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLuqman Olushi O.\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/codeshifu/pingmydyno/issues?q=author%3Acodeshifu\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/codeshifu/pingmydyno/commits?author=codeshifu\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/codeshifu/pingmydyno/commits?author=codeshifu\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#maintenance-codeshifu\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the\n[all-contributors](https://github.com/all-contributors/all-contributors)\nspecification. Contributions of any kind welcome!\n\n## License\n\nThis project is license under\n[MIT](https://github.com/codeshifu/pingmydyno/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluqmanoop%2Fpingmydyno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluqmanoop%2Fpingmydyno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluqmanoop%2Fpingmydyno/lists"}