Package Exports
- supports-webp
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (supports-webp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
supports-webp
Instantly detect support for WEBP images in the browser in 0.2KB
Usage with npm and ES2015
npm install --save supports-webp
import supportsWebP from './supports-webp';
console.log(supportsWebP); // true or false
if(supportsWebP) {
// do something with WebP
}
Usage without build tools
Copy the content of the file dist/supports-webp.browser.js
into your code, don't load that file separately, it's too small. Then:
console.log(window.supportsWebP); // true or false
if(window.supportsWebP) {
// do something with WebP
}
License
MIT © Federico Brigante