caniuse-api
request the caniuse data to check browsers compatibilities
Installation
$ yarn add caniuse-apiUsage
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)
caniuse.getSupport(feature)ask since which browsers versions a feature is available
y: Since which browser version the feature is availablen: Up to which browser version the feature is unavailablea: Up to which browser version the feature is partially supportedx: Up to which browser version the feature is prefixed
caniuse.isSupported(feature, browsers)
caniuse.isSupported(feature, browsers)ask if a feature is supported by some browsers
caniuse.find(query)
caniuse.find(query)search for a caniuse feature name
Ex:
caniuse.getLatestStableBrowsers()
caniuse.getLatestStableBrowsers()get the current version for each browser
caniuse.getBrowserScope()
caniuse.getBrowserScope()returns a list of browsers currently used for the scope of operations
caniuse.setBrowserScope(browserscope)
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?