{"_id":"@armster/axios-fetch-adapter","_rev":"1-6ed1cf889ccb28427a3e15ce39d6356f","name":"@armster/axios-fetch-adapter","dist-tags":{"latest":"0.3.2"},"versions":{"0.3.1":{"name":"@armster/axios-fetch-adapter","version":"0.3.1","description":"Fetch adapter for axios","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"scripts":{"release":"np","test":"echo done","dev":"vite","build":"tsup index.js --format cjs,esm --dts --clean"},"repository":{"type":"git","url":"git+https://github.com/Armster15/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","tsup":"^8.0.1","typescript":"^5.3.3","vite":"^2.8.0"},"peerDependencies":{"axios":">=0.26.0"},"_id":"@armster/axios-fetch-adapter@0.3.1","gitHead":"b039b55c75b4d7064ddc787166022578d5ea7337","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-Of2Td5va0UsQtuPHTbmLG4czAi5qX/ikdammiknuz0SxYr0z+g8SZPELXSAEdNXrYMT/PFc/s1Cf3/h6e2V0KA==","shasum":"a6106f526ce8244c89cd7dab510d2c224eb85299","tarball":"https://registry.npmjs.org/@armster/axios-fetch-adapter/-/axios-fetch-adapter-0.3.1.tgz","fileCount":7,"unpackedSize":14451,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQh7+Ya2EF+UpKoWAknyLOxni+toI8XT29abdE5Po40QIhAOiN3Bba5vqejmOwpkukPcpPabaGORoHtffgpTGrx43D"}]},"_npmUser":{"name":"armster15","email":"armaanaggarwal@gmail.com"},"directories":{},"maintainers":[{"name":"armster15","email":"armaanaggarwal@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/axios-fetch-adapter_0.3.1_1704849284389_0.043245565629880245"},"_hasShrinkwrap":false},"0.3.2":{"name":"@armster/axios-fetch-adapter","version":"0.3.2","description":"Fetch adapter for axios","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"scripts":{"release":"np","test":"echo done","dev":"vite","build":"tsup index.js --format cjs,esm --dts --clean"},"repository":{"type":"git","url":"git+https://github.com/Armster15/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","tsup":"^8.0.1","typescript":"^5.3.3","vite":"^2.8.0"},"peerDependencies":{"axios":">=0.26.0"},"_id":"@armster/axios-fetch-adapter@0.3.2","gitHead":"a567103244916c89421090c3e38ce08f8511196f","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-Qa9w2liwkzQnuyxkN2UYGUYlnqC3qcbxUF5p8YXxk7DMjNDls+F0V8kdrjSwqtY41XwifjRnI22Pal4yK36SUQ==","shasum":"5d48a7c92380b5e6fae3375ad3e4f6e529f4d530","tarball":"https://registry.npmjs.org/@armster/axios-fetch-adapter/-/axios-fetch-adapter-0.3.2.tgz","fileCount":7,"unpackedSize":14475,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC62UvEj13fdX7nE4eT4rdUSRgKJDLqF/ehtu8K4TPHEgIhAJgzfIF2BEb7T6+gsZzjEMyQ9uiUB4nG2u82Zo9iGlIc"}]},"_npmUser":{"name":"armster15","email":"armaanaggarwal@gmail.com"},"directories":{},"maintainers":[{"name":"armster15","email":"armaanaggarwal@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/axios-fetch-adapter_0.3.2_1704850109963_0.07947224186054114"},"_hasShrinkwrap":false}},"time":{"created":"2024-01-10T01:14:44.254Z","0.3.1":"2024-01-10T01:14:44.528Z","modified":"2024-01-10T01:28:30.313Z","0.3.2":"2024-01-10T01:28:30.102Z"},"maintainers":[{"name":"armster15","email":"armaanaggarwal@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/Armster15/axios-fetch-adapter.git"},"author":{"name":"nta.toan@gmail.com"},"bugs":{"url":"https://github.com/vespaiach/axios-fetch-adapter/issues"},"license":"MIT","readme":"This is a fork of [@vespaiach/axios-fetch-adapter](https://github.com/vespaiach/axios-fetch-adapter)\n--\n\n# 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 @armster/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"}