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)

Provides UserAgent and related types to be able to provide a structured understanding of a user agent string.

Classes

c
UserAgent(ua: string | null)

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

  • browser(): Browser

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

  • cpu(): Cpu

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

  • device(): Device

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

  • engine(): Engine

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

  • os(): Os

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

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

    Converts the current instance to a JSON representation.

  • toString(): string

    Converts the current instance to a string.

  • ua(): string

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

Interfaces

I

The browser as described by a user agent string.

  • major: string | undefined

    The major version of a browser.

  • name: string | undefined

    The name of a browser.

  • version: string | undefined

    The version of a browser.

I

The CPU information as described by a user agent string.

I

The device as described by a user agent string.

  • model: string | undefined

    The model of the device.

  • type:
    "console"
    | "mobile"
    | "table"
    | "smartv"
    | "wearable"
    | "embedded"
    | undefined

    The type of device.

  • vendor: string | undefined

    The vendor of the device.

I

The browser engine as described by a user agent string.

  • name: string | undefined

    The browser engine name.

  • version: string | undefined

    The browser engine version.

I

The OS as described by a user agent string.

  • name: string | undefined

    The OS name.

  • version: string | undefined

    The OS version.

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 * as mod from "@std/http/user_agent";
or

Import directly with a jsr specifier

import * as mod from "jsr:@std/http/user_agent";