Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 1.36 KB

README.md

File metadata and controls

30 lines (19 loc) · 1.36 KB

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.