swimsuit

Detect features using Promise

Usage no npm install needed!

<script type="module">
  import swimsuit from 'https://cdn.skypack.dev/swimsuit';
</script>

README

Swimsuit

Detect features using Promise

Join the chat at https://gitter.im/swimsuit/swimsuit Dependency Status Build Status Code Quality Code Coverage

Usage

Add a test

import Swimsuit from 'swimsuit'

Swimsuit.supports('websockets', () => {
  return typeof window !== 'undefined' && typeof window.WebSocket !== 'undefined'
})

Check new support

Swimsuit.websockets.then(() => {
  // It supports websockets
}).catch(() => {
  // It doesn't support websockets
})