import { UserAgent } from "https://deno.land/std@0.201.0/http/user_agent.ts";
Constructors
A representation of user agent string, which can be used to determine environmental information represented by the string. All properties are determined lazily.
import { UserAgent } from "https://deno.land/std@0.201.0/http/user_agent.ts";
Deno.serve((req) => {
const userAgent = new UserAgent(req.headers.get("user-agent") ?? "");
return new Response(`Hello, ${userAgent.browser.name}
on ${userAgent.os.name} ${userAgent.os.version}!`);
});
Methods
toJSON()
toString(): string
[Symbol.for("Deno.customInspect")](inspect: (value: unknown) => string): string
[Symbol.for("nodejs.util.inspect.custom")](): string
depth: number,
options: any,
inspect: (value: unknown, options?: unknown) => string,