cute-fetch

0.2.1 • Public • Published

(FYI: I'm a junior software dev looking for a job in the US. email)

cute-fetch

fetch wrapper but it's modular.

Why

easier to comprehend.

Getting Started

Installation

  1. Install cute-fetch locally.
npm install cute-fetch

Usage

import fch from 'cute-fetch';

// body can be string or any js object

const response = await fch('https://api.example.com/users').POST("any");


const response = await fch('https://api.example.com/users/1').PUT({
    name: 'John Doe',
    email: 'john@example.com',
}); // or string


// await fch('https://api.example.com/data').SOFTWRITE('string')
const response = await fch('https://api.example.com/data').SOFTWRITE({
    key: 'value',
});

// await fch('https://api.example.com/data').OVERWRITE('string')
const response = await fch('https://api.example.com/data').OVERWRITE({
    key: 'newValue',
});


const response = await fch('https://api.example.com/users/1').DELETE();


const response = await fch('https://api.example.com/users').GET();
const data = await response.json();
console.log(data);

Readme

Keywords

Package Sidebar

Install

npm i cute-fetch

Weekly Downloads

1

Version

0.2.1

License

CC-BY-4.0

Unpacked Size

2.95 kB

Total Files

4

Last publish

Collaborators

  • planetrenox