npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

bowser-mini

v2.8.2

Published

Lightweight browser detector with tiny output

Readme

Bowser Mini

This is an exact copy of Bowser, except smaller, and only returns something a logger can parse in a much smaller space. Use the below mapper object to translate the short string.

This package is ideal if you're storing log or analytic data.

String format

The string returned is 3 variables, separated by commas.

Variable 1: The Browser/OS/Platform/Engine types.

  • Byte 1: Browser
  • Byte 2: OS
  • Byte 3: Platform
  • Byte 4: Engine

Variable 2: The Browser version.

Variable 3: The OS version.

The Mapper Object...

cons mapper = {
  browser: { // Byte 1
    'A': 'Android Browser',
    'a': 'Amazon Silk',
    'b': 'Bada',
    'B': 'BlackBerry',
    'C': 'Chrome',
    'c': 'Chromium',
    'E': 'Electron',
    'e': 'Epiphany',
    'F': 'Firefox',
    'f': 'Focus',
    'g': 'Generic',
    'G': 'Googlebot',
    'S": 'Google Search',
    'X': 'Internet Explorer',
    'K': 'K-Meleon',
    'm': 'Maxthon',
    'x': 'Microsoft Edge',
    'z': 'MZ Browser',
    'n': 'NAVER Whale Browser',
    'O': 'Opera',
    'o': 'Opera Coast',
    'P': 'PhantomJS',
    'L': 'Playstation 4',
    'p': 'Puffin',
    'u': 'QupZilla',
    'Q': 'QQ Browser',
    'q': 'QQ Browser Lite',
    'S': 'Safari',
    '1': 'Sailfish',
    '2': 'Samsung Internet for Android',
    '3': 'SeaMonkey',
    '4': 'Sleipnir',
    '5': 'Swing',
    '6': 'Tizen',
    '7': 'UC Browser',
    '8': 'Vivaldi',
    '9': 'SlimerJS',
    'W': 'WebOS Browser',
    'w': 'WeChat',
    'Y': 'Yandex Browser',
    '?': 'Unknown'
  },
  os: { // Byte 2
    'W': 'Windows',
    'w': 'Windows Phone',
    'M': 'macOS',
    'i': 'iOS',
    'A': 'Android',
    'W': 'WebOS',
    'B': 'BlackBerry',
    'b': 'Bada',
    'T': 'Tizen',
    'L': 'Linux',
    'C': 'Chrome OS',
    'P': 'PlayStation 4',
    'R': 'Roku'
  },
  platforms: { // Byte 3
    'T': 'tablet',
    'M': 'mobile',
    'D': 'desktop',
    'V': 'tv'
  },
  engines: { // Byte 4
    'E': 'EdgeHTML',
    'B': 'Blink',
    'T': 'Trident',
    'P': 'Presto',
    'G': 'Gecko',
    'W': 'WebKit'
  }
}

Bowser

A small, fast and rich-API browser/platform/engine detector for both browser and node.

  • Small. Use plain ES5-version which is ~4.8kB gzipped.
  • Optimized. Use only those parsers you need — it doesn't do useless work.
  • Multi-platform. It's browser- and node-ready, so you can use it in any environment.

Don't hesitate to support the project on Github or OpenCollective if you like it ❤️ Also, contributors are always welcome!

Financial Contributors on Open Collective Build Status Greenkeeper badge Coverage Status Downloads

Contents

Overview

The library is made to help to detect what browser your user has and gives you a convenient API to filter the users somehow depending on their browsers.

⚠️ Version 2.0 breaking changes ⚠️

Version 2.0 has drastically changed the API. All available methods are on the docs page.

For legacy code, check out the 1.x branch and install it through npm install [email protected].

Use cases

First of all, require the library. This is a UMD Module, so it will work for AMD, TypeScript, ES6, and CommonJS module systems.

const Bowser = require("bowser"); // CommonJS

import * as Bowser from "bowser"; // TypeScript

import Bowser from "bowser"; // ES6 (and TypeScript with --esModuleInterop enabled)

By default, the exported version is the ES5 transpiled version, which do not include any polyfills.

In case you don't use your own babel-polyfill you may need to have pre-built bundle with all needed polyfills. So, for you it's suitable to require bowser like this: require('bowser/bundled'). As the result, you get a ES5 version of bowser with babel-polyfill bundled together.

You may need to use the source files, so they will be available in the package as well.

Browser props detection

console.log(Bowser.parse(window.navigator.userAgent));

// outputs
"CWDB,79.0.3945.88,NT 10.0"