Skip to main content
Deno 2 is finally here 🎉️
Learn more

deno_ogp_parser

codecov
OGP Parser for Deno

Usage

import { parsedMeta } from "https://deno.land/x/ogp_parser/mod.ts"

const result = parsedMeta("https://example.com")
console.log(result.title) // -> "Example Domain"

If you want to restrict the allowed origins, use the allowOrigins option.

import { parsedMeta } from "https://deno.land/x/ogp_parser/mod.ts"

const result = parsedMeta("https://example.com", {
  allowOrigins: ["https://example.com"],
});
console.log(result.title) // -> "Example Domain"

Recommends

Since metadata does not change frequently, we recommend caching the retrieved results in Deno KV.