request-destination 🔮
Guess the fetch API request destination based on a file path.
Use Case
Useful when generating Link
rel=preload
headers for HTTP/2 Server Push and other web performance optimisations.
https://fetch.spec.whatwg.org/#concept-request-destination
Installation
npm install request-destination
Usage
const requestDestination = // 'script' // 'style' // 'font' // '' // ''
Colophon
Made with ❤️ by Sebastiaan Deckers.