https://github.com/cssinjs/caniuse-support
Query the caniuse offline database for feature support.
https://github.com/cssinjs/caniuse-support
Last synced: 9 months ago
JSON representation
Query the caniuse offline database for feature support.
- Host: GitHub
- URL: https://github.com/cssinjs/caniuse-support
- Owner: cssinjs
- License: mit
- Created: 2016-11-21T11:24:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T03:58:52.000Z (over 3 years ago)
- Last Synced: 2025-07-08T18:44:30.525Z (10 months ago)
- Language: TypeScript
- Size: 1.21 MB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# caniuse-support
[](https://travis-ci.org/cssinjs/caniuse-support)
[](https://coveralls.io/github/cssinjs/caniuse-support?branch=master) [](https://greenkeeper.io/)
Query the [caniuse offline database](https://github.com/Fyrd/caniuse) for feature support.
Includes browser detection using [bowser](https://github.com/ded/bowser).
## Usage
```javascript
import { getSupport, detectBrowser, getVersionIndex } from "caniuse-support";
// 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 a list of queryable features see [here](https://github.com/Fyrd/caniuse/tree/master/features-json).
## Playground
Checkout this [code pen](http://codepen.io/wikiwi/pen/QGpgKp?editors=0012).