caniuse

v0.1.3
Compatibility validation for support of HTML5, CSS3, SVG and more in desktop and mobile browsers.
css3 html5 svg browser

node-caniuse

A node library to do compatibility validation for support of HTML5, CSS3, SVG and more in desktop and mobile browsers. Based on data from Fyrd's caniuse.

Usage

Check if CSS 3D transform is supported on android 2.3:

var query = require('caniuse').query
    result;

result = query('transforms3d', {name:'android', version: '2.3'});

switch(result) {
case 'y':
    console.log('Supported.');
    break;
case 'y x':
    console.log('Supported, and vendor prefixed.');
    break;
case 'a':
    console.log('Partially supported.');
    break;
case 'a x':
    console.log('Partially supported, and vendor prefixed.');
    break;
case 'u':
    console.log('Unknown.');
    break;
default:
    console.log('NOT supported.');
}

Check if @font-face is supported on latest version of IE:

var query = require('caniuse').query
    result;

result = query('fontface', 'ie');

if (result === 'y' || result === 'y x') {
    console.log('Fully Supported!');
}

Related Projects

Fyrd's caniuse: https://github.com/Fyrd/caniuse

npm i caniuse

Metadata

  • Unknown
  • >= 0.4.0
  • Chengwei Wu
  • released 1/4/2013

Downloads

Maintainers