1.1.1 • Published 8 years ago

is-browser-supported v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

is-browser-supported Build Status

Check if user agent string matches with browser criterias like in Autoprefixer.

Install

$ npm install --save is-browser-supported

Usage

const isBrowserSupported = require('is-browser-supported');

isBrowserSupported('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)', 'last 1 version');
//=> false

isBrowserSupported('Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko', 'last 1 version');
//=> true

API

isBrowserSupported(userAgent, selections)

userAgent

Type: string

A user agent string to be checked.

selections

Type: string Default: same as Browserslist

Browser criteria to check the user agent string against, see Browserslist's documentation for more details.

License

MIT © Fast Monkeys