wuchengwei/caniuse

Forked from Fyrd/caniuse

Raw browser/feature support data from caniuse.com

http://caniuse.com

Language: JavaScript


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.

Installing

npm install 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'});

// query result:
// -2 : NOT supported
// -1 : NOT supported, but has polyfill available
//  0 : unknown
//  1 : partially supported, and vendor prefixed
//  2 : partially supported
//  3 : supported, and vendor prefixed
//  4 : supported

if (result > 2) {
    console.log('Fully supported!');
}

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

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

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

if (result > 2) {
    console.log('Fully Supported!');
}

You may want to update the data from caniuse:

cd tool
node updateData.js

You can also update data in code:

var updateData = require('caniuse').updateData;
updateData(function(err) {
    if (err) {
        throw err;
    }
    // do some query
});

Related Projects

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

Project Statistics

Sourcerank 0
Repository Size 276 KB
Stars 7
Forks 4
Watchers 2
Open issues disabled
Dependencies 0
Contributors 2
Tags 2
Created
Last updated
Last pushed

Top Contributors See all

wuchengwei Alexis Deveria

Packages Referencing this Repo

caniuse
Compatibility validation for support of HTML5, CSS3, SVG and more in desktop and mobile browsers.
Latest release 0.1.3 - Updated - 7 stars

Recent Tags See all

v0.1.2 October 26, 2012
v0.1.1 August 08, 2012

Something wrong with this page? Make a suggestion

Last synced: 2016-04-24 07:12:17 UTC

Login to resync this repository