{"id":16525799,"url":"https://github.com/amamov/swr-fetcher","last_synced_at":"2025-09-13T05:48:22.845Z","repository":{"id":65512076,"uuid":"392671900","full_name":"amamov/swr-fetcher","owner":"amamov","description":"Advanced fetcher function npm package for React SWR","archived":false,"fork":false,"pushed_at":"2021-08-06T05:15:40.000Z","size":9,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T17:16:10.071Z","etag":null,"topics":["axios","npm","npm-package","react","swr","typescript"],"latest_commit_sha":null,"homepage":"","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/amamov.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":"2021-08-04T12:00:21.000Z","updated_at":"2022-11-29T14:50:53.000Z","dependencies_parsed_at":"2023-01-26T19:25:11.982Z","dependency_job_id":null,"html_url":"https://github.com/amamov/swr-fetcher","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/amamov/swr-fetcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amamov%2Fswr-fetcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amamov%2Fswr-fetcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amamov%2Fswr-fetcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amamov%2Fswr-fetcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amamov","download_url":"https://codeload.github.com/amamov/swr-fetcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amamov%2Fswr-fetcher/sbom","scorecard":{"id":188191,"data":{"date":"2025-08-11","repo":{"name":"github.com/amamov/swr-fetcher","commit":"9d89f7b5002a60248e6cdc6ec3a3e5753bfa099f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T20:09:58.271Z","repository_id":65512076,"created_at":"2025-08-16T20:09:58.271Z","updated_at":"2025-08-16T20:09:58.271Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274923199,"owners_count":25374628,"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-09-13T02:00:10.085Z","response_time":70,"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":["axios","npm","npm-package","react","swr","typescript"],"created_at":"2024-10-11T17:06:57.898Z","updated_at":"2025-09-13T05:48:22.787Z","avatar_url":"https://github.com/amamov.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [swr-fetcher](https://www.npmjs.com/package/swr-fetcher)\n\n\u003e Advanced OOP principles fetcher npm package for [React SWR](https://github.com/vercel/swr) based in [axios](https://github.com/axios/axios).\n\n\u003e In fact, you can use swr even if you don't use it. In this case, it can be used as a class that wraps axios based on the singleton pattern.\n\n## Quick Start\n\n```shell\nnpm i --save swr-fetcher\n```\n\n```shell\nyarn add swr-fetcher\n```\n\n## Examples\n\n```typescript\nimport useSWR from 'swr'\nimport Fetcher, { FetchError } from 'swr-fetcher'\n\n// Singleton Pattern\nconst fetcher = new Fetcher({ baseURL: 'https://api.example.com' })\n\nexport default function App(): JSX.Element {\n  const { data: users, error } = useSWR\u003cUser[], FetchError\u003e(\n    '/api/users',\n    fetcher.get.bind(fetcher),\n  )\n\n  // code...\n}\n```\n\n```typescript\n// post fetcher\n\nconst { data: users, error } = useSWR\u003cUser[], FetchError\u003e(\n  '/api/users',\n  fetcher.post.bind(fetcher, requestData),\n)\n```\n\nYou can use like this.\n\n```typescript\nconst fetchConfig: FetchConfig = {\n  headers: { 'X-Requested-With': 'XMLHttpRequest' },\n  timeout: 1000, // default is `0` (no timeout)\n  withCredentials: false, // default\n}\n\nconst { data: users, error } = useSWR\u003cUser[], FetchError\u003e('/api/users', (url) =\u003e\n  fetcher.get.bind(fetcher)(url, fetchConfig),\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famamov%2Fswr-fetcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famamov%2Fswr-fetcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famamov%2Fswr-fetcher/lists"}