New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

caniuse-support

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caniuse-support

Query the caniuse offline database for feature support.

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

caniuse-support

NPM Version Widget Build Status Widget Coverage Status Widget

Query the caniuse offline database for feature support.

Includes browser detection using bowser.

Usage

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

// Get feature support of current browser.
getSupport("transforms2d"); // { level: "none", needPrefix: false, notes: [] }

// 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 convenience, get current browser.
console.log(`${currentBrowser.id} ${currentBrowser.version}`);

For a list of queryable features see here.

Playground

Checkout this code pen.

Known issues

  • Currently there is no support for Opera Mini detection until this issue is resolved.

Keywords

FAQs

Package last updated on 15 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc