caniuse-api

request the caniuse data to check browsers compatibilities

Installation

$ yarn add caniuse-api

Usage

const caniuse = require('caniuse-api')

caniuse.getSupport('border-radius')
caniuse.isSupported('border-radius', 'ie 8, ie 9')
caniuse.setBrowserScope('> 5%, last 1 version')
caniuse.getSupport('border-radius')
// ...

API

caniuse.getSupport(feature)

ask since which browsers versions a feature is available

  • y: Since which browser version the feature is available

  • n: Up to which browser version the feature is unavailable

  • a: Up to which browser version the feature is partially supported

  • x: Up to which browser version the feature is prefixed

caniuse.isSupported(feature, browsers)

ask if a feature is supported by some browsers

caniuse.find(query)

search for a caniuse feature name

Ex:

caniuse.getLatestStableBrowsers()

get the current version for each browser

caniuse.getBrowserScope()

returns a list of browsers currently used for the scope of operations

caniuse.setBrowserScope(browserscope)

if you do not like the default browser scope, you can set it globally by using this method

  • browserscope should be a 'autoprefixer' formatted string


Last updated

Was this helpful?