@isz/wants
Version: 
🐾 What does the request want?
35 lines (26 loc) • 553 B
Markdown
# /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>

</center>