Helps run checks on browser features


Keywords
detection, feature, supports
License
Unlicense
Install
npm install sports@4.0.0

Documentation

about

Helps detect browser features.

setup

Find the latest version on the npm registry:

# Contains named exports for a range of newer browser features
npm install @thewhodidthis/sports

usage

Do I have the EventSource API available on this browser?

import { eventsource } from 'sports'

// Implicitly tries `'EventSource' in window`
if (eventsource()) {
  console.log('Fortunately yes')
}

What checks and features are available in all?

import * as sports from 'sports'

Object.entries(sports).forEach(([feature, check]) => {
  console.log(feature, check())
})