Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

low-browser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

low-browser

Internet Explorer and Microsoft Edge browsers definition

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18
increased by500%
Maintainers
1
Weekly downloads
 
Created
Source

Low Browser

Internet Explorer and Microsoft Edge browsers definition on JavaScript

Why?

Sometimes need to define only browsers from Microsoft. Other tools on JavaScript is bloated and slower. Because they seek to support most browsers.

Features

  • Pure, small (about 600 bytes gzip) and fast.
  • Has no dependencies.
  • Focused only on Microsoft browsers.
  • Exports as UMD: Browser (global), AMD, CommonJS.
  • Exports as ES Module.
  • Has types for TypeScript.

Table of Contents

Install

$ yarn add low-browser

OR get it in https://unpkg.com/low-browser@0.3/dist/

Usage

Function parses given user agent string and returns data object

ES Module

Can be downloaded from https://unpkg.com/low-browser@0.3/dist/low-browser.esm.min.js

import lowBrowser from './low-browser.esm.min.js'
//...
const {name, version} = lowBrowser('some user agent string')

if (name === 'IE' && version === '8.0') {
  // do something
}

UMD

Can be downloaded from https://unpkg.com/low-browser@0.3/dist/low-browser.umd.min.js

Browser (global)
var data = lowBrowser('some user agent string')

if (data.name === 'IE' && data.version === '8.0') {
  // do something
}
AMD
define('your-module', ['low-browser'], function (lowBrowser) {
  var data = lowBrowser('some user agent string')

  if (data.name === 'IE' && data.version === '8.0') {
    // do something
  }
})
CommonJS
const lowBrowser = require('low-browser')
//...
const {name, version} = lowBrowser('some user agent string')

if (name === 'IE' && version === '8.0') {
  // do something
}

Types

For TypeScript. Included in package. Can be downloaded from https://unpkg.com/low-browser@0.3/dist/low-browser.d.ts

Data object

Returns data object after parsing given user agent string

userAgent

Input user agent string

Type: string

name

Browser name

Type: string
May be Edge, IE, IEMobile

version

Browser version

Type: string
Example: 5.5b1

core

Browser core name

Type: string
May be EdgeHTML or Trident.

coreVersion

Browser core version

Type: string
Example: 4.0b1

os

Operating System

Type: string
Example: Windows NT 10.0

osBuild

Operating System Build Number
Only for Microsoft Edge browser

Type: number
Example: 16299

gamePlatform

Game Platform

Type: string
May be Xbox 360 or Xbox One

Tests

# Clone repository
$ git clone https://github.com/Arttse/low-browser.git && cd low-browser/

# Install all dependencies
$ yarn

# Run tests
$ yarn run test

License

MIT © 2015-2018 Nikita Bystrov (Arttse)

Keywords

FAQs

Package last updated on 29 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc