The compact, Promise-based, and browser-native HTTP fetch wrapper.
For more detailed documentation, please visit the dedicated fetchet API Reference.
Fetchet is intended for client-side use and is available as a NPM package.
GET is the default HTTP method if no method is specified in the options, similar to fetch()
Fetchet is a minimal wrapper around the browser-native fetch, using the same API with a few minor configurations and additional options.
The parameters option (an object) in the request options is automatically parsed into URL search params string and appended to the request URL.
Request URL: https://dummyjson.com/recipes?limit=10&skip=10&select=name,ingredients,instructions
The json option (a boolean) is set to true by default. This means you don't need to manually set headers: { 'Content-Type': 'application/json' } or use JSON.stringify(body) for POST, PUT, or PATCH requests. If you want to send the body in a non-JSON format, set json to false.
If you have suggestions for how this project could be improved, or want to report a bug, feel free to open an issue! We welcome all contributions.
Likewise, before contributing please read the contribution guide.
Fetchet is heavily inspired by the axios and of course fetch API.
I wrote a fetch wrapper for a small side project, and instead of copying and pasting that code, I decided to expand on it and turn it into a public package.
.png)

