@readme/ua-platformer
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@readme/ua-platformer

ua-platformer is a library to determine the platform of a given User-Agent header. This library supports platform detection on a wide variety of cloud platforms, GitHub workflows, HTTP libraries, programming languages, and web browsers.

Build

Install

npm install --save @readme/ua-platformer

Usage

import uaPlatformer from '@readme/ua-platformer';
// const { default: uaPlatformer } = require('@readme/ua-platformer');

const useragent = 'Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.22000.832'

console.log(uaPlatformer(useragent)); // { name: 'PowerShell', browser: false }

Examples

User Agent Platform
Amazon Cloudfront Amazon
GuzzleHttp/6.5.5 curl/7.29.0 PHP/8.1.12 PHP
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.5304.110 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) Google
Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.22000.832 PowerShell
Faraday v1.10.0 Ruby
rdme-github/8.1.1 ReadMe
Typhoeus - https://github.com/typhoeus/typhoeus Ruby
WordPress/6.0.3; https://example.com PHP

/@readme/ua-platformer/

    Package Sidebar

    Install

    npm i @readme/ua-platformer

    Weekly Downloads

    90

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    7.91 kB

    Total Files

    5

    Last publish

    Collaborators

    • llimllib
    • darrenyong
    • gratcliff
    • dannobytes
    • gkoberger
    • domharrington
    • mjcuva
    • kanadgupta
    • jonursenbach
    • rafegoldberg
    • dashron
    • iliast