# known-fetch-body

> Detect if the type of an argument is supported by the request body of browser fetch api and node-fetch.

Latest version **0.1.1** (published 2016-09-12) · 0 weekly downloads

## Install

```sh
npm install known-fetch-body
pnpm add known-fetch-body
yarn add known-fetch-body
bun add known-fetch-body
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-09-12 |
| First published | 2016-09-12 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | fenfeizeng |

## Links

- npm: https://www.npmjs.com/package/known-fetch-body
- Repository: https://github.com/zengfenfei/known-fetch-body
- Homepage: https://github.com/zengfenfei/known-fetch-body#readme
- Issues: https://github.com/zengfenfei/known-fetch-body/issues
- npm.io page: https://npm.io/package/known-fetch-body

## Dependencies (1)

- [form-data](https://npm.io/package/form-data.md) ^1.0.1

## Recent versions

- 0.1.1 (latest) — 2016-09-12
- 0.1.0 — 2016-09-12

## README

# Detect fetch API body type

Detect the type of a variable is the known request body type of browser fetch API and `node-fetch`. Currently known types are string, FormData, Blob, URLSearchParams, Buffer, stream.Readable.

## Install
`npm install known-fetch-body`

## Quick Start
```typescript
import isKnownReqBodyType from "known-fetch-body";
import {createReadStream} from "stream";

isKnownReqBodyType("string");   // true
isKnownReqBodyType(new FormData()); // true
isKnownReqBodyType(new URLSearchParams());  // true
isKnownReqBodyType(new Buffer());   // true
isKnownReqBodyType(createReadStream("filePath"));    // true
isKnownReqBodyType({}); // false
```

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