@eternaljs/user-agent
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

User Agent

A user agent request is a string of text that identifies the client software requesting online content. It's contained in the HTTP headers and is sent to the web server when connecting to a website.

Installing

Using npm:

$ npm install @eternaljs/user-agent

Using yarn:

$ yarn add @eternaljs/user-agent

Imports

These examples assume you're in node, or something similar:

// JavaScript
const { UserAgent } = require("@eternaljs/user-agent");

// TypeScript
import { UserAgent } from "@eternaljs/user-agent";

Usage Example

const { UserAgent } = userAgent(agent)
{
  "browser": { "name": "Chrome", "version": "119.0.0.0" },
  "device": { "type": "desktop","os": "Windows 10.0","platform": "Microsoft Windows"},
  "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
}

License

MIT

Package Sidebar

Install

npm i @eternaljs/user-agent

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

65.8 kB

Total Files

11

Last publish

Collaborators

  • gchandrasekhar