Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

caniuse-support

wikiwi121MIT1.0.4TypeScript support: included

Query the caniuse offline database for feature support.

caniuse, query, offline

readme

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.

changelog

1.0.2 (August 15, 2019)

  • Dependencies update

1.0.1 (March 21, 2019)

  • Updated README

1.0.0 (March 21, 2019)

  • Deprecated currentBrowser

0.4.4 (March 21, 2019)

  • Dependencies update

0.4.3 (September 1, 2019)

  • Dependencies update

0.4.2 (July 3, 2018)

  • Migrated to caniuse-lite

0.4.1 (February 28, 2017)

  • Use chrome desktop data for and_chr

0.4.0 (December 15, 2016)

  • Support getVersionIndex()

0.3.0 (December 01, 2016)

  • Support caniuse notes

0.2.0 (November 21, 2016)

  • Initial public release