open-index/open-npm huggingface dataset:
npm package: @isz/content-type-is
Description: 🐾 What kind of content is this request/response?
Author: omrilotan
Latest version: 0.0.1

# @isz/content-type-is [![](https://img.shields.io/npm/v/@isz/content-type-is)](https://www.npmjs.com/package/@isz/content-type-is)

Check the content type of a request or response in a simple way.

```ts
import { contentTypeIs } from "@isz/content-type-is";
// …
const its = contentTypeIs(response);

if (its.html) {
	// Handle HTML response
} else if (its.json) {
	// Handle JSON response
} else {
	// Handle other response types
}
```

## Supported getters

- html
- json
- plain
- image
- xml
- javascript
- css
- stream
- pdf
- video
- audio
- binary
- form
- multipart

<center>

![](https://github.com/user-attachments/assets/32fb4611-072a-4bdd-a075-f56ed7f60937)

</center>
npm package: @isz/wants
Description: 🐾 What does the request want?
Author: omrilotan
Latest version: 0.0.1

# @isz/wants [![](https://img.shields.io/npm/v/@isz/wants)](https://www.npmjs.com/package/@isz/wants)

Check what a request wants in a simple way.

```ts
import { wants } from "@isz/wants";
// …
const itWants = wants(response);

if (itWants.html) {
	// Handle HTML request
} else if (itWants.json) {
	// Handle JSON request
} else {
	// Handle other requests
}
```

## Supported getters

- any
- css
- html
- image
- json
- grpc
- stream
- xml

<center>

![](https://github.com/user-attachments/assets/17f6915a-8acc-4771-bcd8-25e6a44f44ce)

</center>