@henrikdk/myfetch

0.0.2 • Public • Published

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.

Package Sidebar

Install

npm i @henrikdk/myfetch

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

10.3 kB

Total Files

3

Last publish

Collaborators

  • henrikdk