{"id":26252561,"url":"https://github.com/melon-studio/fetchs","last_synced_at":"2025-03-13T17:19:37.202Z","repository":{"id":212846435,"uuid":"732444692","full_name":"Melon-Studio/Fetchs","owner":"Melon-Studio","description":"Fetchs is a powerful and flexible HTTP client library for making network requests in JavaScript applications. ","archived":false,"fork":false,"pushed_at":"2025-01-29T15:52:19.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-13T17:19:32.810Z","etag":null,"topics":["http","javascript","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/Melon-Studio.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-16T17:38:17.000Z","updated_at":"2025-01-29T15:52:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"68b8c357-faad-45eb-8e2a-f0e247f1995d","html_url":"https://github.com/Melon-Studio/Fetchs","commit_stats":null,"previous_names":["melon-studio/fecths"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melon-Studio%2FFetchs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melon-Studio%2FFetchs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melon-Studio%2FFetchs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melon-Studio%2FFetchs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Melon-Studio","download_url":"https://codeload.github.com/Melon-Studio/Fetchs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243447641,"owners_count":20292452,"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":["http","javascript","typescript"],"created_at":"2025-03-13T17:19:36.311Z","updated_at":"2025-03-13T17:19:37.197Z","avatar_url":"https://github.com/Melon-Studio.png","language":"TypeScript","readme":"## Fetchs\n\nFetchs is a powerful and flexible HTTP client library for making network requests in JavaScript applications. It provides a wide range of features such as caching, request retrying, request and response interceptors, and timeout handling. Built on top of the native fetch API, Fetchs offers a simple and intuitive interface to handle various HTTP operations with ease.\n\n### Features\n\n- **Multiple HTTP Methods**: Supports all major HTTP methods including GET, POST, PUT, PATCH, DELETE, and HEAD.\n- **Caching Mechanism**: Enables caching of responses with customizable time-to-live (TTL) and storage options (memory or localStorage).\n- **Request Retrying**: Automatically retries failed requests based on specified status codes and retry configurations.\n- **Interceptors**: Allows adding custom logic before sending requests and after receiving responses.\n- **Timeout Handling**: Sets a timeout for requests to prevent hanging requests.\n- **Customizable Configuration**: Provides a global configuration object that can be customized for each request.\n\n### Installation\n\nDownload the release to your project.\n\n### Basic Usage\n\n```javascript\nimport { Fetchs, FetchsConfig } from 'fetchs';\n\n// Create a new instance of Fetchs with optional global configuration\nconst fetchs = new Fetchs({\n    baseUrl: 'https://www.example.com',\n    timeout: 3000,\n    headers: {\n        'Authorization': 'Bearer YourAccessToken'\n    }\n});\n\n// Define the request configuration\nconst config: FetchsConfig = {\n    method: 'GET',\n    responseType: 'json'\n};\n\n// Execute a request\nfetchs.executeRequest\u003c{ message: string }\u003e('/data', config)\n   .then(response =\u003e {\n        console.log('Response:', response);\n    })\n   .catch(error =\u003e {\n        console.error('Error:', error);\n    });\n```\n\nFor more details and advanced usage, refer to the [documentation](#) (Not yet open).\n\n### License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE.txt) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelon-studio%2Ffetchs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelon-studio%2Ffetchs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelon-studio%2Ffetchs/lists"}