# @aliezsid/fit

> Fit Minimal wrapper around window.fetch to make my life easier

Latest version **1.0.2** (published 2020-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @aliezsid/fit
pnpm add @aliezsid/fit
yarn add @aliezsid/fit
bun add @aliezsid/fit
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-07-16 |
| First published | 2020-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sidgroks@gmail.com |
| Maintainers | aliezsid |

## Links

- npm: https://www.npmjs.com/package/@aliezsid/fit
- Repository: https://github.com/barelyhuman/fit
- Homepage: https://github.com/barelyhuman/fit#readme
- Issues: https://github.com/barelyhuman/fit/issues
- npm.io page: https://npm.io/package/@aliezsid/fit

## Recent versions

- 1.0.2 (latest) — 2020-07-16
- 1.0.1 — 2020-07-15

## README

<h1 align="center">
Fit
</h1>
<p align="center">Minimal wrapper around <code>window.fetch</code> to make my life easier</p>

## Disclaimer

I understand the readme isn't thorough right now and only important aspects of the api are out here, for the remaining stuff you can go through the source code, it's a very simple wrapper.

## Install

```sh
npm i @aliezsid/fit
```

## Usage

Fit has a simple API

```js

fit(url).[method].then().catch();


// Get Request

const data = await fit("localhost:3000/api/posts/1").get()
// or
fit("localhost:3000/api/posts/1").get()
.then(data=>{
    console.log(data);
})
.catch(err=>{
    console.log(err);
})



// Post Request

const data = await fit("localhost:3000/api/posts/1").post({
    params:1
})
// or
fit("localhost:3000/api/posts/1").post({
    params:1
})
.then(data=>{
    console.log(data);
})
.catch(err=>{
    console.log(err);
})

```

## API

```js
// @param body || null - depending on method
// @param [options] - fetch options that you want to pass through

fit(url).get([options]);
fit(url).post(body, [options]);
fit(url).patch(body, [options]);
fit(url).put(body, [options]);
fit(url).delete(options);
```

---
_Source: https://npm.io/package/@aliezsid/fit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
