# letch

> A local fetch for the times you don't need a server.

Latest version **1.0.2** (published 2022-12-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install letch
pnpm add letch
yarn add letch
bun add letch
```

## 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 | 2022-12-07 |
| First published | 2022-12-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jelle |
| Maintainers | jellehak |
| Keywords | fetch |

## Links

- npm: https://www.npmjs.com/package/letch
- npm.io page: https://npm.io/package/letch

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2022-12-07
- 1.0.1 — 2022-12-07
- 1.0.0 — 2022-12-07

## README

A local fetch for the times you don't need a server.

# Installation
## CDN
```js
import {letch} from "https://cdn.jsdelivr.net/npm/letch"
```

```html
<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>

<script type="importmap">
    {
        "imports": {
            "letch": "https://cdn.jsdelivr.net/npm/letch"
        }
    }
</script>
```

# Usage
```js
import {letch} from "letch"

letch('/users', { method: 'POST', body: { user: 'john' } })
letch('/users/1', { method: 'PUT', body: { user: 'john' } })
letch('/users/2', { method: 'PUT', body: { user: 'marry' } })
letch('/products/1', { method: 'PUT', body: { name: 'product 1', price: 1 } })
letch('/products/2', { method: 'PUT', body: { name: 'product 2', price: 1 } })
console.table(letch('/products'))
console.table(letch('/users'))
letch('/products/1', { method: 'DELETE' })

// Batch delete
letch('/users', { method: 'GET' }).forEach(element => {
    letch(`/users/${element.id}`, {method: 'DELETE'})
});
console.table(letch('/users'))
```

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