{"id":13473724,"url":"https://github.com/k4m4/cloudflare-detect","last_synced_at":"2025-05-03T12:30:24.513Z","repository":{"id":29693491,"uuid":"122501937","full_name":"k4m4/cloudflare-detect","owner":"k4m4","description":"Detect whether a site is running behind Cloudflare.","archived":false,"fork":false,"pushed_at":"2024-06-16T09:52:51.000Z","size":261,"stargazers_count":24,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T15:51:53.720Z","etag":null,"topics":["cloudflare","detection","nodejs","waf"],"latest_commit_sha":null,"homepage":"","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/k4m4.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"license","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":"2018-02-22T16:08:17.000Z","updated_at":"2025-01-04T19:35:19.000Z","dependencies_parsed_at":"2024-10-30T04:52:03.267Z","dependency_job_id":null,"html_url":"https://github.com/k4m4/cloudflare-detect","commit_stats":{"total_commits":38,"total_committers":4,"mean_commits":9.5,"dds":"0.26315789473684215","last_synced_commit":"9b2010a044bd3e2e1112bdd5b4b4fe75fb3adcc0"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k4m4%2Fcloudflare-detect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k4m4%2Fcloudflare-detect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k4m4%2Fcloudflare-detect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k4m4%2Fcloudflare-detect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k4m4","download_url":"https://codeload.github.com/k4m4/cloudflare-detect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252190435,"owners_count":21708881,"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":["cloudflare","detection","nodejs","waf"],"created_at":"2024-07-31T16:01:06.253Z","updated_at":"2025-05-03T12:30:24.252Z","avatar_url":"https://github.com/k4m4.png","language":"JavaScript","funding_links":[],"categories":["DNS"],"sub_categories":[],"readme":"# cloudflare-detect [![Last version](https://img.shields.io/github/tag/k4m4/cloudflare-detect.svg?style=flat-square)](https://www.npmjs.org/package/cloudflare-detect) [![NPM Status](https://img.shields.io/npm/dm/cloudflare-detect.svg?style=flat-square)](https://www.npmjs.org/package/cloudflare-detect) ![github actions status](https://github.com/k4m4/cloudflare-detect/actions/workflows/build_and_publish.yml/badge.svg)\n\nDetect whether a site is running behind Cloudflare.\n\n## Install\n\n```shell\nnpm install --save cloudflare-detect\n```\n\nNote that versions \u003e 2 of this package are ESM-only. Use 1.x for CommonJS support.\n\n## Usage\n\n```js\nconst cloudflareDetect = require('cloudflare-detect');\n\ncloudflareDetect('nikolaskama.me').then(cf =\u003e {\n\tconsole.log(cf);\n\t//=\u003e true\n});\n\ncloudflareDetect('google.com').then(cf =\u003e {\n\tconsole.log(cf);\n\t//=\u003e false\n});\n```\n\n\n## API\n\n### cloudflareDetect(targets, [options])\n\nReturns a `Promise` for a `boolean` which is `true` if any of the `targets` are running behind Cloudflare.\n\n#### targets\n\nType: `string` `Array`\n\nOne or more targets to check. Can either be a full [URL](https://nodejs.org/api/url.html) like `https://hostname` or just `hostname`. When the protocol is missing from a target `http` is assumed.\n\n#### options\n\n##### timeout\n\nType: `number`\n\nTimeout in milliseconds after which a request is considered failed. Default: `5000`.\n\n## Credits\n\n- [cloudflare-ip](https://github.com/danneu/cloudflare-ip) - a lot of the code for verifying that the host's IP address is within Cloudflare's range has been adapted from this repo (which doesn't seem to be maintained anymore) by [danneu](https://github.com/danneu).\n- [is-reachable](https://github.com/sindresorhus/is-reachable) - some of the IP verification \u0026 DNS lookup code, as well as the format of the readme file, has been adapted from this repo by [sindresorhus](https://github.com/sindresorhus).\n\n## Contributors\n\n- [Michael Bianco](https://github.com/iloveitaly)\n\n## License\n\nMIT © [Nikolaos Kamarinakis](https://nikolaskama.me/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk4m4%2Fcloudflare-detect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk4m4%2Fcloudflare-detect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk4m4%2Fcloudflare-detect/lists"}