webp-image-support

0.6.0 • Public • Published

WebP Test

build

This plugin will detect if the browser supports the WebP format, resolving a Promise with true if WebP support is present, and false otherwise.

Example

index.js

import { supportsWebp } from './webp-image-support';

(async () => {

	const supported = await supportsWebp();
	if(supported) {
		console.log(`This browser supports WebP images`);
	} else {
		console.log(`This browser does not support WebP images.`);
	}
})();

GitLab

Submit issues, request features, check out the repo here: https://git.xvrqt.com/amy/webp-support

Readme

Keywords

Package Sidebar

Install

npm i webp-image-support

Weekly Downloads

1

Version

0.6.0

License

BSD-3-Clause

Unpacked Size

5.55 kB

Total Files

8

Last publish

Collaborators

  • xvrqt