• Version 1.1.4
  • Published
  • 24.5 kB
  • 2 dependencies
  • BSD-3-Clause license


npm i browser-capabilities
yarn add browser-capabilities
pnpm add browser-capabilities


Detect browser capabilities from a user agent string.



function browserCapabilities

browserCapabilities: (userAgent: string) => Set<BrowserCapability>;
  • Return the set of capabilities for a user agent string.

function parseVersion

parseVersion: (version: string | undefined) => number[];
  • Parse a "x.y.z" version string of any length into integer parts. Returns -1 for a part that doesn't parse.

function versionAtLeast

versionAtLeast: (atLeast: number[], version: number[]) => boolean;
  • Return whether version is at least as high as atLeast.

Type Aliases

type BrowserCapability

type BrowserCapability =
| 'es2015'
| 'es2016'
| 'es2017'
| 'es2018'
| 'push'
| 'serviceworker'
| 'modules';
  • A feature supported by a web browser.

type UserAgentPredicate

type UserAgentPredicate = (ua: InstanceType<typeof UAParser>) => boolean;

    Package Files (1)

    Dependencies (2)

    Dev Dependencies (2)

    Peer Dependencies (0)

    No peer dependencies.


    To add a badge like this badgeto your package's README, use the codes available below.

    You may also use to create a custom badge linking to

    • Markdown
    • HTML
      <a href=""><img src="" alt=""></a>