supports-webp-sync
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

supports-webp-sync

npm npm

Checks if the browser supports WebP without any costly requests.

May give false negatives for some obscure non-WebKit browsers.

Live check: https://ihordiachenko.github.io/supports-webp-sync/

Install

npm i -S supports-webp-sync

Usage

import { checkWebPSupport } from 'supports-webp-sync'

if (checkWebPSupport()) {
  // Get some WebP images
}

/supports-webp-sync/

    Package Sidebar

    Install

    npm i supports-webp-sync

    Weekly Downloads

    616

    Version

    1.1.3

    License

    MIT

    Unpacked Size

    5.2 kB

    Total Files

    6

    Last publish

    Collaborators

    • ihor.diachenko