fetchu.js
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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}!`)
});

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i fetchu.js

    Weekly Downloads

    7

    Version

    1.0.1

    License

    CC-BY-NC-ND-4.0

    Unpacked Size

    8.71 kB

    Total Files

    11

    Last publish

    Collaborators

    • tolga1452