Skip to content

Determine the platform of a given User Agent. 🕵️

License

Notifications You must be signed in to change notification settings

readmeio/ua-platformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

About

Determine the platform of a given User Agent. 🕵️

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published