{"id":30060151,"url":"https://github.com/tiaanduplessis/simple-fetch-client","last_synced_at":"2025-08-08T01:42:25.457Z","repository":{"id":57360118,"uuid":"138433466","full_name":"tiaanduplessis/simple-fetch-client","owner":"tiaanduplessis","description":"A friendly fetch client","archived":false,"fork":false,"pushed_at":"2020-06-07T04:07:04.000Z","size":409,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-12T15:45:45.285Z","etag":null,"topics":["client","fetch"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiaanduplessis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-23T21:05:08.000Z","updated_at":"2022-05-30T09:46:19.000Z","dependencies_parsed_at":"2022-09-06T22:22:34.829Z","dependency_job_id":null,"html_url":"https://github.com/tiaanduplessis/simple-fetch-client","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tiaanduplessis/simple-fetch-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fsimple-fetch-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fsimple-fetch-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fsimple-fetch-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fsimple-fetch-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiaanduplessis","download_url":"https://codeload.github.com/tiaanduplessis/simple-fetch-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fsimple-fetch-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269352333,"owners_count":24402672,"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-07T02:00:09.698Z","response_time":73,"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":["client","fetch"],"created_at":"2025-08-08T01:42:12.479Z","updated_at":"2025-08-08T01:42:25.417Z","avatar_url":"https://github.com/tiaanduplessis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 🌐 simple-fetch-client\n[![package version](https://img.shields.io/npm/v/simple-fetch-client.svg?style=flat-square)](https://npmjs.org/package/simple-fetch-client)\n[![package downloads](https://img.shields.io/npm/dm/simple-fetch-client.svg?style=flat-square)](https://npmjs.org/package/simple-fetch-client)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n[![package license](https://img.shields.io/npm/l/simple-fetch-client.svg?style=flat-square)](https://npmjs.org/package/simple-fetch-client)\n[![make a pull request](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\n\u003e A friendly fetch client\n\n## Table of Contents\n\n- [🌐 simple-fetch-client](#simple-fetch-client)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Install](#install)\n  - [Usage](#usage)\n  - [Contribute](#contribute)\n  - [License](#license)\n\n## Features\n\n- Retries and timeouts on requests via [tenacious-fetch](https://github.com/tiaanduplessis/tenacious-fetch)\n- Using middleware via [nanomiddleware](https://github.com/tiaanduplessis/nanomiddleware)\n- Parsing of responses via [fetch-response-enhancer](https://github.com/tiaanduplessis/fetch-response-enhancer)\n\n## Install\n\nThis project uses [node](https://nodejs.org) and [npm](https://www.npmjs.com).\n\n```sh\n$ npm install simple-fetch-client\n$ # OR\n$ yarn add simple-fetch-client\n```\n\n## Usage\n\n```js\nimport 'babel-polyfill'\nimport Client from 'simple-fetch-client'\n\nconst api = new Client('https://jsonplaceholder.typicode.com')\n\napi.useMiddleware((res) =\u003e {\n  console.log(res.url, res.status)\n  return res\n})\n\napi.get('/posts/1').then(res =\u003e console.log(res.data.userId)) // 1\napi.post('/posts', {hello: true}).then(res =\u003e console.log(res.data)) // Object {id: 101}\napi.get('/posts', {params: {q: true}})\n\nclass MyAPI extends Client {\n  constructor (config = {}) {\n    super('https://jsonplaceholder.typicode.com', {\n      delay: 2000 // delay requests with 2 seconds\n    })\n\n    this.useMiddleware(res =\u003e {\n      if (config.log) {\n        console.log('MyAPI', res.url, res.data)\n      }\n\n      return res\n    })\n  }\n\n  async getPosts () {\n    const res = this.get('/posts').then(res =\u003e res.d)\n    return res.body\n  }\n}\n\nconst myAPI = new MyAPI({log: true})\n\nmyAPI.getPosts().then(console.log)\n\n```\n\n## Contribute\n\n1. Fork it and create your feature branch: git checkout -b my-new-feature\n2. Commit your changes: git commit -am 'Add some feature'\n3. Push to the branch: git push origin my-new-feature\n4. Submit a pull request\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fsimple-fetch-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiaanduplessis%2Fsimple-fetch-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fsimple-fetch-client/lists"}