Tolga1452 / fetchu.js

A simple and modern fetch wrapper for Node.js

Home Page:https://www.npmjs.com/package/fetchu.js/v/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fetchu.js

A simple and modern fetch wrapper for Node.js

Installation

npm install fetchu.js

Usage

const { request, RequestMethod } = require('fetchu.js');

request('https://example.com', {
    method: RequestMethod.Get,
    headers: {
        'Content-Type': 'application/json'
    },
    body: {
        foo: 'bar'
    }
}, {
    isOk: (response) => console.log(`API responded successful ${response.status} ${response.statusText}!`),
    isNotOk: (response) => console.log(`API responded unsuccessful ${response.status} ${response.statusText}!`)
});

About

A simple and modern fetch wrapper for Node.js

https://www.npmjs.com/package/fetchu.js/v/latest

License:Other


Languages

Language:TypeScript 100.0%