# @schirrel/request

> A simple wrapper for fetch api

Latest version **1.3.0** (published 2022-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @schirrel/request
pnpm add @schirrel/request
yarn add @schirrel/request
bun add @schirrel/request
```

## 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.3.0 |
| Published | 2022-06-20 |
| First published | 2020-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | @schirrel |
| Maintainers | schirrel |
| Keywords | fetch, api |

## Links

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

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2022-06-20
- 1.2.0 — 2020-04-24
- 1.0.3 — 2020-04-13
- 1.0.2 — 2020-04-13
- 1.0.1 — 2020-04-13

## README

# Request
A simple promise based and single file wrapper for newers to start using Fetch API.

For those who dont want a big library to simple requests, and yet want to simplify the fetch use.

[![npm version](https://badge.fury.io/js/%40schirrel%2Frequest.svg)](https://badge.fury.io/js/%40schirrel%2Frequest)

## Installing

Just import the `Request.js` file or run `npm i @schirrel/request`.

## Examples

See [Example Folder](https://github.com/schirrel/request/tree/master/docs)

#### GET

```javascript
Request.get("https://jsonplaceholder.typicode.com/todos/1")
.then((res) => {})
.catch((err) => {});

```
#### POST
```javascript
Request.post('https://jsonplaceholder.typipre.com/posts', {
    body: {
        title:'Ahoy'
    }
})
.then((res) => {})
.catch((err) => {});

```
#### PUT
```javascript
Request.put('https://jsonplaceholder.typicode.com/posts/1', {
body: {
   id:1,
   title:'Ahoy'
    }
 })
.then((res) => {})
.catch((err) => {});

```
#### DELETE
```javascript
Request.delete('https://jsonplaceholder.typicode.com/posts/1')
.then((res) => {})
.catch((err) => {});

```


For a http client you can also check [api-request](https://github.com/schirrel/api-request) current under development

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