{"id":19926610,"url":"https://github.com/microlinkhq/ping-url","last_synced_at":"2025-08-11T15:06:31.932Z","repository":{"id":35692536,"uuid":"217139206","full_name":"microlinkhq/ping-url","owner":"microlinkhq","description":"Fast DNS resolution caching results for a while.","archived":false,"fork":false,"pushed_at":"2024-05-08T08:28:26.000Z","size":142,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-24T15:18:53.000Z","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/microlinkhq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-10-23T19:39:20.000Z","updated_at":"2024-12-18T12:01:19.000Z","dependencies_parsed_at":"2024-05-08T09:45:25.234Z","dependency_job_id":null,"html_url":"https://github.com/microlinkhq/ping-url","commit_stats":{"total_commits":118,"total_committers":4,"mean_commits":29.5,"dds":0.211864406779661,"last_synced_commit":"fd17a63d0e03ce051fce1b3beba83aab0ed60b61"},"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/microlinkhq/ping-url","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microlinkhq%2Fping-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microlinkhq%2Fping-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microlinkhq%2Fping-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microlinkhq%2Fping-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microlinkhq","download_url":"https://codeload.github.com/microlinkhq/ping-url/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microlinkhq%2Fping-url/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269907406,"owners_count":24494354,"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-11T02:00:10.019Z","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":[],"created_at":"2024-11-12T22:29:54.357Z","updated_at":"2025-08-11T15:06:31.880Z","avatar_url":"https://github.com/microlinkhq.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/microlinkhq/cdn/raw/master/dist/logo/banner.png#gh-light-mode-only\" alt=\"microlink logo\"\u003e\n  \u003cimg src=\"https://github.com/microlinkhq/cdn/raw/master/dist/logo/banner-dark.png#gh-dark-mode-only\" alt=\"microlink logo\"\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/div\u003e\n\n![Last version](https://img.shields.io/github/tag/microlinkhq/ping-url.svg?style=flat-square)\n[![Coverage Status](https://img.shields.io/coveralls/microlinkhq/ping-url.svg?style=flat-square)](https://coveralls.io/github/microlinkhq/ping-url)\n[![NPM Status](https://img.shields.io/npm/dm/@microlink/ping-url.svg?style=flat-square)](https://www.npmjs.org/package/@microlink/ping-url)\n\n\u003e Fast DNS resolution caching results for a while.\n\n## Motivation\n\nPing an URL for getting the canonical URL and store the result into a cache, respecting a Time-to-Live (*TTL*) for the next lookup.\n\nSuggested TTL could be:\n\n- **Very Short**: 300 seconds (5 minutes).\n- **Short**: 3600 seconds (1 hour).\n- **Long**: 86400 seconds (24 hours).\n- **Insanity**: 604800 seconds (7 days).\n\nThis library support any data storage provided by [`keyv`](https://npm.im/keyv).\n\n## Install\n\n```bash\n$ npm install @microlink/ping-url --save\n```\n\n## Usage\n\n```js\nconst createPingUrl = require('@microlink/ping-url')\nconst cache = new Map()\nconst pingUrl = createPingUrl({ store: cache, ttl: 3600 })\n\n;(async () =\u003e {\n  await pingUrl('https://example.com') // MISS, do the request\n  await pingUrl('https://example.com') // HIT, serve from cache!\n})()\n```\n\nThe payload returned by `pingUrl` will be `response` but without any stream object there.\n\n## API\n\n### createPingUrl([keyvOptions], [memoOpts]) → pingUrl(url, [gotOpts])\n\n#### keyvOptions\n\nSee [`keyv#options`](https://www.npmjs.com/package/keyv#new-keyvuri-options).\n\n#### memoOpts\n\nSee [`@keyvhq/memoize`](https://github.com/microlinkhq/keyv/tree/master/packages/memoize).\n\n#### gotOpts\n\nType: `object`\n\nAny option provided here will passed to [got#options](https://github.com/sindresorhus/got#options).\n\n## License\n\n**@microlink/ping-url** © [Microlink](https://microlink.io), released under the [MIT](https://github.com/microlink/ping-url/blob/master/LICENSE.md) License.\u003cbr\u003e\nAuthored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/microlink/ping-url/contributors).\n\n\u003e [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · Twitter [@microlinkhq](https://twitter.com/microlinkhq)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrolinkhq%2Fping-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrolinkhq%2Fping-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrolinkhq%2Fping-url/lists"}