Skip to main content

@std/http@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score70%
Published2 years ago (0.215.0)
class UserAgent

A representation of user agent string, which can be used to determine environmental information represented by the string. All properties are determined lazily.

Constructors

new UserAgent(ua: string | null)

Constructs a new instance.

Properties

The name and version of the browser extracted from the user agent string.

readonly
cpu: Cpu

The architecture of the CPU extracted from the user agent string.

The model, type, and vendor of a device if present in a user agent string.

The name and version of the browser engine in a user agent string.

readonly
os: Os

The name and version of the operating system in a user agent string.

A read only version of the user agent string related to the instance.

Methods

Custom output for Deno.inspect.

[Symbol.for("nodejs.util.inspect.custom")](
depth: number,
options: any,
inspect: (
value: unknown,
options?: unknown
) => string
): string

Custom output for Node's util.inspect.

toJSON(): { browser: Browser; cpu: Cpu; device: Device; engine: Engine; os: Os; ua: string; }

Converts the current instance to a JSON representation.

Converts the current instance to a string.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/http

Import symbol

import { UserAgent } from "@std/http/user_agent";
or

Import directly with a jsr specifier

import { UserAgent } from "jsr:@std/http/user_agent";