{"_id":"@adraheem/axios-next","_rev":"3-6d1f08f87933647dc2c7c7319fbe348c","name":"@adraheem/axios-next","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@adraheem/axios-next","version":"1.0.0","description":"","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","scripts":{"tsc":"tsc -p tsconfig.json && tsc -p tsconfig-cjs.json","prepublishOnly":"npm run tsc"},"keywords":[],"license":"ISC","devDependencies":{"typescript":"^5.2.2"},"dependencies":{"@types/is-empty":"^1.2.1","is-empty":"^1.2.0"},"repository":{"type":"git","url":"git+https://github.com/Adraheem/axios-fetch.git"},"author":{"name":"Raheem Adebayo","email":"adraheemzy@gmail.com","url":"https://github.com/Adraheem"},"gitHead":"b2cca72f213a12e8ddca5d1714071b17088e4bb8","bugs":{"url":"https://github.com/Adraheem/axios-fetch/issues"},"homepage":"https://github.com/Adraheem/axios-fetch#readme","_id":"@adraheem/axios-next@1.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-khBZh6FjTfRm1uA9Nyc0YsR95lEHVxGhwPpzW7/4M4TtojLhVcqcv/3g17suD9BoKzsrfvFH0C0DaLkP3R/Vlw==","shasum":"35a867e834ce34ab3e39e19577dec391369674a4","tarball":"https://registry.npmjs.org/@adraheem/axios-next/-/axios-next-1.0.0.tgz","fileCount":9,"unpackedSize":11412,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDz905RLQPe+NBJt0eBkIiKx22lw4oiwcO65cuwdtaTwgIhANOfBaXvvlUWcafbpxON49ugq6fpwlE60Sh51yuXeEsN"}]},"_npmUser":{"name":"adraheem","email":"adraheemzy@gmail.com"},"directories":{},"maintainers":[{"name":"adraheem","email":"adraheemzy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/axios-next_1.0.0_1695785583051_0.7578597190597602"},"_hasShrinkwrap":false},"1.0.1":{"name":"@adraheem/axios-next","version":"1.0.1","description":"`axios-next` is a versatile HTTP client module for Next.js projects, inspired by Axios. It allows  you to make HTTP requests with ease using fetch, configure global settings, and use a familiar API.","main":"./lib/index.js","types":"./lib/types/types.d.ts","scripts":{"tsc":"npm run clean && tsc -p tsconfig.json","prepublishOnly":"npm run tsc","clean":"rimraf lib"},"keywords":["axios","next","fetch","cache"],"license":"MIT","devDependencies":{"typescript":"^5.2.2"},"dependencies":{"@types/is-empty":"^1.2.1","is-empty":"^1.2.0"},"repository":{"type":"git","url":"git+https://github.com/Adraheem/axios-fetch.git"},"author":{"name":"Raheem Adebayo","email":"adraheemzy@gmail.com","url":"https://github.com/Adraheem"},"gitHead":"395ea9a3985b04d246e9b05eba6a70908fc95b44","bugs":{"url":"https://github.com/Adraheem/axios-fetch/issues"},"homepage":"https://github.com/Adraheem/axios-fetch#readme","_id":"@adraheem/axios-next@1.0.1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-/XsdI5Nf3rgXa7C3u/8Z7sjfdWt0G2mNFY9Voiv1d66DnMLU0Tvn468zEvwRu1wlsDJH6cBzexfDNL4n/y1ZKg==","shasum":"2c72edca66808080aaa2a12ed63b77379eeab15f","tarball":"https://registry.npmjs.org/@adraheem/axios-next/-/axios-next-1.0.1.tgz","fileCount":6,"unpackedSize":8802,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrsD4hfZYvvltURsErxzZTkXEkWypqMUNUb6QL6Y6YfgIgK6C/mNOZsW+suXAcCTzQYQ/CXRVXR1wNZCD/bC1gu2Y="}]},"_npmUser":{"name":"adraheem","email":"adraheemzy@gmail.com"},"directories":{},"maintainers":[{"name":"adraheem","email":"adraheemzy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/axios-next_1.0.1_1695807469393_0.20021449500111"},"_hasShrinkwrap":false},"1.0.2":{"name":"@adraheem/axios-next","version":"1.0.2","description":"`axios-next` is a versatile HTTP client module for Next.js projects, inspired by Axios. It allows  you to make HTTP requests with ease using fetch, configure global settings, and use a familiar API.","main":"./lib/index.js","types":"./lib/types/types.d.ts","scripts":{"tsc":"npm run clean && tsc -p tsconfig.json","prepublishOnly":"npm run tsc","clean":"rimraf lib"},"keywords":["axios","next","fetch","cache"],"license":"MIT","devDependencies":{"typescript":"^5.2.2"},"dependencies":{"@types/is-empty":"^1.2.1","is-empty":"^1.2.0"},"repository":{"type":"git","url":"git+https://github.com/Adraheem/axios-fetch.git"},"author":{"name":"Raheem Adebayo","email":"adraheemzy@gmail.com","url":"https://github.com/Adraheem"},"gitHead":"b8eeddec1be8b57cdc698f0cada9a22f46593ecb","bugs":{"url":"https://github.com/Adraheem/axios-fetch/issues"},"homepage":"https://github.com/Adraheem/axios-fetch#readme","_id":"@adraheem/axios-next@1.0.2","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-jAq/CD6AAmNGkkaMEdkXcss3UvrEp2yK2Foi/CXp2cO4wOURs1mvHm+oElEPNRsDno0Qt28SHw8t/kV+Qepxgw==","shasum":"76551da06bf9f10386ab916bb69dfb7fa1146757","tarball":"https://registry.npmjs.org/@adraheem/axios-next/-/axios-next-1.0.2.tgz","fileCount":6,"unpackedSize":9821,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClBJ4vJPjELKq26a69S13gG5GiXyuBbkf2FagSIPoH6AIgdsZv3I3am/fUfJWr/lBafOWlrIY7B6SCqvCqEcdlOMo="}]},"_npmUser":{"name":"adraheem","email":"adraheemzy@gmail.com"},"directories":{},"maintainers":[{"name":"adraheem","email":"adraheemzy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/axios-next_1.0.2_1695807816635_0.9342569957347733"},"_hasShrinkwrap":false},"1.0.3":{"name":"@adraheem/axios-next","version":"1.0.3","description":"`axios-next` is a versatile HTTP client module for Next.js projects, inspired by Axios. It allows  you to make HTTP requests with ease using fetch, configure global settings, and use a familiar API.","main":"./lib/index.js","types":"./lib/types.d.ts","scripts":{"tsc":"npm run clean && tsc -p tsconfig.json","prepublishOnly":"npm run tsc","clean":"rimraf lib"},"keywords":["axios","next","fetch","cache"],"license":"MIT","devDependencies":{"typescript":"^5.2.2"},"dependencies":{"@types/is-empty":"^1.2.1","is-empty":"^1.2.0"},"repository":{"type":"git","url":"git+https://github.com/Adraheem/axios-fetch.git"},"author":{"name":"Raheem Adebayo","email":"adraheemzy@gmail.com","url":"https://github.com/Adraheem"},"gitHead":"8d3a7b543a57af523c1bc732c64273ef32ab823a","bugs":{"url":"https://github.com/Adraheem/axios-fetch/issues"},"homepage":"https://github.com/Adraheem/axios-fetch#readme","_id":"@adraheem/axios-next@1.0.3","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-KzQIi+XIqxmhHQpD5yTALdz1XD7AQ9gLppPYGDpnVKhzsPI9D/HLs6aqQy7orh9zwbqPp0FdUESV3hbuI4MDZQ==","shasum":"bd2e490149d665a32d3f7db37926d001bad418e1","tarball":"https://registry.npmjs.org/@adraheem/axios-next/-/axios-next-1.0.3.tgz","fileCount":6,"unpackedSize":9808,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAlOc5MeCvXJBEcpl2MdWu+HvjcTbo06ekqnelodLZdwIgXbcqUDReBqbHIcA7RLlzemmpu9XDgaNfBpr89WqmZRs="}]},"_npmUser":{"name":"adraheem","email":"adraheemzy@gmail.com"},"directories":{},"maintainers":[{"name":"adraheem","email":"adraheemzy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/axios-next_1.0.3_1695808486051_0.7586468610031716"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-27T03:33:02.900Z","1.0.0":"2023-09-27T03:33:03.250Z","modified":"2023-09-27T09:54:46.412Z","1.0.1":"2023-09-27T09:37:49.604Z","1.0.2":"2023-09-27T09:43:36.833Z","1.0.3":"2023-09-27T09:54:46.248Z"},"maintainers":[{"name":"adraheem","email":"adraheemzy@gmail.com"}],"homepage":"https://github.com/Adraheem/axios-fetch#readme","keywords":["axios","next","fetch","cache"],"repository":{"type":"git","url":"git+https://github.com/Adraheem/axios-fetch.git"},"author":{"name":"Raheem Adebayo","email":"adraheemzy@gmail.com","url":"https://github.com/Adraheem"},"bugs":{"url":"https://github.com/Adraheem/axios-fetch/issues"},"license":"MIT","readme":"# axios-next\n\n`axios-next` is a versatile HTTP client module for Next.js projects, inspired by Axios. It allows \nyou to make HTTP requests with ease using fetch, configure global settings, and use a familiar API.\n\n## Installation\n\nYou can install `axios-next` via npm or yarn:\n```shell\nnpm i @adraheem/axios-next\n```\nor\n```shell\nyarn add @adraheem/axios-next\n```\n\n# Usage\n## Creating an Instance\nYou can create an instance of `axios-next` to configure settings like baseUrl and default headers. \nHere's an example:\n```javascript\nimport axiosFetch from \"@adraheem/axios-fetch\";\n\nconst instance = MyNodeModule.create({\n  baseUrl: 'https://api.example.com',\n  headers: {\n    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',\n    'Content-Type': 'application/json',\n  },\n});\n```\n\n## Making Requests\nOnce you have an instance, you can make HTTP requests using the same familiar methods as Axios: get, post, put, patch, and delete. The parameters for these methods mirror Axios as well:\n\n```typescript\n// SIGNATURE\ninstance.get(path, data?, options?)\n  .then((response: FetchResponse<any>) => {\n    // Handle the response\n  })\n  .catch((error) => {\n    // Handle errors\n  });\n```\n\n```typescript\n// GET request\nimport {FetchResponse} from \"@adraheem/axios-next\";\n\ninstance.get('/api/resource', {params: {slug: 'abcde'}}, {next: {revalidate: 5000}})\n  .then((response: FetchResponse<any>) => {\n    // Handle the response\n  })\n  .catch((error) => {\n    // Handle errors\n  });\n\n// POST request\ninstance.post('/api/resource', {\n  data: {\n    // Request data\n  },\n})\n  .then((response: FetchResponse<any>) => {\n    // Handle the response\n  })\n  .catch((error) => {\n    // Handle errors\n  });\n\n// PUT request, etc.\n```\n\n## Using Without Creating an Instance\nIf you prefer, you can also use `axios-next` without creating an instance. It provides a simple and \nconvenient way to make requests directly:\n```typescript\nimport axiosFetch, {FetchResponse} from \"@adraheem/axios-next\";\n\n// GET request without an instance\naxiosFetch.get('https://api.example.com/api/resource')\n  .then((response: FetchResponse<any>) => {\n    // Handle the response\n  })\n  .catch((error) => {\n    // Handle errors\n  });\n\n```\n\nHave a look at what the FetchResponse looks like\n```typescript\ntype FetchResponse<T = any> = {\n  data: T;\n  status: number;\n  statusText: string;\n  headers: HeadersInit;\n  request?: any;\n}\n```\n\n# Customization\n`axios-fetch` is highly customizable, allowing you to configure various options globally or per \nrequest. Refer to the official documentation for more details on available configuration options.\n\n# Contributing\nIf you'd like to contribute to `axios-fetch` or report issues, please check out the Contribution \nGuidelines.\n\n# License\nThis project is licensed under the MIT License.\n\n# Acknowledgments\n- `axios-fetch` is inspired by the Axios library.\n- [Raheem O. Adebayo (@Adraheem)](https://github.com/Adraheem)\n","readmeFilename":"readme.MD","description":"`axios-next` is a versatile HTTP client module for Next.js projects, inspired by Axios. It allows  you to make HTTP requests with ease using fetch, configure global settings, and use a familiar API."}