caniuse-support
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i caniuse-support

Weekly Downloads

13

Version

1.0.4

License

MIT

Unpacked Size

2.26 MB

Total Files

23

Last publish

Collaborators

  • wikiwi