1.0.0 • Published 12 months ago

supports-avif v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

supports-avif

Same as supports-webp, but for avif

Install

pnpm add supports-avif

Or you can use npm or yarn.

Usage

import supportsAvif from 'supports-avif';
// supportsAvif is a Promise

supportsAvif.then((isSupported) => document.body.classList.toggle('avif', isSupported));

// Or use async/await:
if (await supportsAvif) {
	console.log('Load AVIF!');
} else {
	console.log('Load WEBP!');
}
1.0.0

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago