Socket
Socket
Sign inDemoInstall

@types/ua-parser-js

Package Overview
Dependencies
0
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/ua-parser-js

TypeScript definitions for ua-parser-js


Version published
Weekly downloads
1.3M
decreased by-0.12%
Maintainers
1
Install size
8.62 kB
Created
Weekly downloads
 

Package description

What is @types/ua-parser-js?

The @types/ua-parser-js package provides TypeScript type definitions for the ua-parser-js library, which is a tool for parsing browser user agent strings. It allows developers to easily identify browser, engine, OS, CPU, and device details from the user agent string.

What are @types/ua-parser-js's main functionalities?

Parsing User Agent String

This feature allows you to parse the user agent string of the browser and extract details such as the name and version of the browser.

import UAParser from 'ua-parser-js';

const parser = new UAParser();
const result = parser.getResult();
console.log(result.browser); // Outputs browser details

Extracting OS Information

With this functionality, you can extract information about the operating system from the user agent string, including the OS name and version.

import UAParser from 'ua-parser-js';

const parser = new UAParser();
const result = parser.getResult();
console.log(result.os); // Outputs operating system details

Getting Device Information

This allows you to get details about the device, such as its model and type (e.g., mobile, tablet), from the user agent string.

import UAParser from 'ua-parser-js';

const parser = new UAParser();
const result = parser.getResult();
console.log(result.device); // Outputs device details such as model and type

Other packages similar to @types/ua-parser-js

Readme

Source

Installation

npm install --save @types/ua-parser-js

Summary

This package contains type definitions for ua-parser-js (https://github.com/faisalman/ua-parser-js).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ua-parser-js.

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Viktor Miroshnikov, Lucas Woo, Pablo Rodríguez, Piotr Błażejewicz, and BendingBender.

FAQs

Last updated on 07 Nov 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc