1.0.6 β€’ Published 3 years ago

fetch-api-data v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

fetch-api-data

npm bundle size NPM npm

πŸš€ Promise based function for calling API easily in Node Js or any Javascript framework!

Installing

Using npm:

$ npm install fetch-api-data

Example

import fetchAPIData from "fetch-api-data"

or

const fetchAPIData = require('fetch-api-data')

For GET Request

fetchAPIData("https://jsonplaceholder.typicode.com/todos").then((res) => {
    console.log(res);
}).catch((err) => {
    console.log(err);
});

For POST Request

const formData = {
    email: "test@test.com",
    password: "1234"
}
fetchAPIData("https://reqres.in/api/users", formData, "POST").then((json) => {
    console.log(json)
});

πŸš€And you are all set to use this package!

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago