Latest Supply Chain Attack:Mini Shai-Hulud Hits @antv npm Packages, 639 Versions Compromised.Learn More
Socket
Book a DemoSign in
Socket

@rojiwon123/fetch

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@rojiwon123/fetch

Fetch API wrapped around the original fetch function

unpublished
latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
0
Created
Source

Fetch API

npm version Downloads Release 🔖

Fetch API wrapped around the original fetch function

Installation

npm i @rojiwon123/fetch

Example

import fetch from "@rojiwon123/fetch";

void fetch.request
    .query({ url: "http://localhost:3000", method: "GET" })
    .then(fetch.response.match({ 200: fetch.response.none() }))
    .then(console.log); // null

// request headers content-type value is `application/json; charset=utf-8`
void fetch.request
    .json({
        url: "http://localhost:3000",
        body: { test: "test" },
        method: "POST",
    })
    .then(
        fetch.response.match({
            201: fetch.response.json((i) => i), // status 201 case
            _: fetch.response.text((i) => i), // default case
        }),
    )
    .then(console.log); // log response body

Keywords

fetch

FAQs

Package last updated on 15 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts