Skip to content

Query the caniuse offline database for feature support.

License

Notifications You must be signed in to change notification settings

cssinjs/caniuse-support

Repository files navigation

caniuse-support

Build Status Coverage Status Greenkeeper badge

Query the caniuse offline database for feature support.

Includes browser detection using bowser.

Usage

import { getSupport, detectBrowser, getVersionIndex } from "caniuse-support";

// Get feature support of specific browser.
getSupport("flexbox", { id: "chrome", version: "6.0" }); // { level: "partial", needPrefix: true, notes: [1] }

// Get feature support of specific browser using an user agent string.
const userAgent = "Mozilla/5.0 (Mobile; rv:26.0) Gecko/26.0 Firefox/26.0";
getSupport("transforms2d", detectBrowser(userAgent)); // { level: "full", needPrefix: false, notes: [] }

// Get matching caniuse version index.
getVersionIndex(detectBrowser(userAgent)); // "26"

For a list of queryable features see here.

Playground

Checkout this code pen.

About

Query the caniuse offline database for feature support.

Resources

License

Stars

Watchers

Forks

Packages

No packages published