myFetch
A school project around the concept of UMD. It's possible to fetch for Node and with backwards compatibility on older browsers using XMLHttpRequest.
How to install
npm i @henrikdk/myfetch
How to use
const myFetch = require("@henrikdk/myfetch");
myFetch.init({
address: "https://reqres.in/api/users/",
key: "Authorization key"
});
myFetch.get("1").then(result => console.log(result));
//Expected output: Object from api.
Functions
- GET - Retrieve data from API.
- PUT - Replace data from API.
- PATCH - Modify data from API.
- REMOVE - Remove data from API.
- POST - Create data to API.