{"_id":"@banyudu/axios-fetch-adapter","name":"@banyudu/axios-fetch-adapter","dist-tags":{"latest":"0.3.2"},"versions":{"0.3.2":{"name":"@banyudu/axios-fetch-adapter","version":"0.3.2","description":"Fetch adapter for axios","main":"index.js","module":"index.js","types":"index.d.ts","scripts":{"release":"np","test":"echo done","dev":"vite"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"repository":{"type":"git","url":"git+https://github.com/vespaiach/axios-fetch-adapter.git"},"keywords":["axios","adapter","fetch"],"author":{"name":"nta.toan@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/vespaiach/axios-fetch-adapter/issues"},"homepage":"https://github.com/vespaiach/axios-fetch-adapter#readme","devDependencies":{"axios":"^0.27.2","np":"^7.6.1","vite":"^2.8.0"},"peerDependencies":{"axios":">=0.26.0"},"gitHead":"e9c7d5260f159901fc7bb03211f984e86dccc048","_id":"@banyudu/axios-fetch-adapter@0.3.2","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-XBcE6Gm78BmXwXCVALhIZKBnA7DUPEkINJPclPja7xwjDArRqWBl4zyGBDtdi4u/nzL4ZkhhyJ32P9MMgPvAnA==","shasum":"c5ca6069017b6d89fd6e9a5d2444878ce2e99886","tarball":"https://registry.npmjs.org/@banyudu/axios-fetch-adapter/-/axios-fetch-adapter-0.3.2.tgz","fileCount":5,"unpackedSize":10211,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN2F3rY3ShM5lS+xRxw5qXn/ajblN/icQQBnIebIMvOQIgO8owKb9x5ZucjgGo/O5lfv65tg2nRJa7Hz00vXXKGxc="}]},"_npmUser":{"name":"banyudu","email":"banyudu@gmail.com"},"directories":{},"maintainers":[{"name":"banyudu","email":"banyudu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/axios-fetch-adapter_0.3.2_1691477878499_0.2424226427836229"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-08T06:57:58.442Z","0.3.2":"2023-08-08T06:57:58.672Z","modified":"2023-08-08T06:57:58.832Z"},"maintainers":[{"name":"banyudu","email":"banyudu@gmail.com"}],"description":"Fetch adapter for axios","homepage":"https://github.com/vespaiach/axios-fetch-adapter#readme","keywords":["axios","adapter","fetch"],"repository":{"type":"git","url":"git+https://github.com/vespaiach/axios-fetch-adapter.git"},"author":{"name":"nta.toan@gmail.com"},"bugs":{"url":"https://github.com/vespaiach/axios-fetch-adapter/issues"},"license":"MIT","readme":"# Why\n\nI'm going to adopt PWA to my web applications and those web apps are heavily using Axios with the default XMLHTTPRequest adapter. Hence, I have to switch to Fetch adapter; However, Axios doesn't have an adapter for fetch API for now. So I write one to use while waiting for an offical one from Axios.\n\n# Installation and Usage\n\nYou can install the adapter directly from this repository URL or feel free to copy its source code to your project.\n\n``` sh\nnpm install axios\nnpm install @vespaiach/axios-fetch-adapter\n```\n\nThere are two ways to use it:\n\n1.  Create a new instance of Axios and pass this adapter in configuration\n\n``` js\nconst instance = axios.create({\n  baseURL: 'https://some-domain.com/api/',\n  timeout: 1000,\n  adapter: fetchAdapter\n  ....\n});\n```\n\n2.  Pass this adapter in each of request\n\n``` js\naxios.request({\n  url: '/user',\n  method: 'get',\n  adapter: fetchAdapter\n  ...\n})\n```\n\n3.  Use with FormData \n\n``` js\naxios.request({\n  url: '/user',\n  method: 'post',\n  adapter: fetchAdapter\n  data: new FormData(formId)\n  ...\n})\n```\n\n# Note\n\n- Since, this adapter relies on fetch API so it won't work in Node environment\n","readmeFilename":"README.md"}