@isz/wants 
Check what a request wants in a simple way.
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