{"id":19621357,"url":"https://github.com/commenthol/uses-proxy","last_synced_at":"2025-08-10T07:07:44.396Z","repository":{"id":57690002,"uuid":"473482273","full_name":"commenthol/uses-proxy","owner":"commenthol","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-16T07:13:34.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-07T05:18:35.599Z","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/commenthol.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":"2022-03-24T06:24:41.000Z","updated_at":"2025-01-16T07:13:35.000Z","dependencies_parsed_at":"2022-09-26T20:53:00.804Z","dependency_job_id":null,"html_url":"https://github.com/commenthol/uses-proxy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/commenthol/uses-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fuses-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fuses-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fuses-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fuses-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commenthol","download_url":"https://codeload.github.com/commenthol/uses-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fuses-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269688678,"owners_count":24459500,"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-10T02:00:08.965Z","response_time":71,"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-11T11:22:38.194Z","updated_at":"2025-08-10T07:07:44.347Z","avatar_url":"https://github.com/commenthol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# uses-proxy\n\n\u003e Check if a url shall be proxied through a http(s) proxy\n\nImplements the recommendations from https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/\n\nDetects and uses `http(s)_proxy` and `no_proxy` environment variables.\n\n- Environment variables lowercase precedence. `no_proxy` comes before `NO_PROXY`\n- Matches suffixes\n- Strips leading `.`\n- `*` matches all hosts\n- No support for regexes.\n- Supports CIDR Blocks\n- Does not match loopback IPs\n\n# usage\n\n```\nnpm i uses-proxy\n```\n\n```js\nimport { usesProxy, shouldProxy } from 'uses-proxy'\nconst {\n  proxyUri, // proxy uri from https_proxy, http_proxy, ...\n  protocol, // used protocol of proxy\n  noProxy  // no_proxy env var content\n} = usesProxy()\n\nconst matcher = shouldProxy({\n  proxyUri,\n  noProxy: noProxy || 'localhost, tempuri.org'\n})\n\nmatcher('localhost') // \u003e\u003e false\nmatcher('test.com') // \u003e\u003e true\nmatcher('test.tempuri.org') // \u003e\u003e false\nmatcher('tempuri.org') // \u003e\u003e false\n```\n\n# license\n\nMIT licensed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fuses-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommenthol%2Fuses-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fuses-proxy/lists"}