0.1.6 • Published 1 year ago

@bobheadxi/metadata v0.1.6

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

metadata

Pull metadata from a webpage through a crude heuristic that leverages regular HTML metadata, OpenGraph, JSON+LD data, and more.

npm i -s @bobheadxi/metadata
import { parseMeta } from '@bobheadxi/metadata';

export async function getMeta() {
    const resp = await fetch('https://bobheadxi.dev');
    const doc = new DOMParser().parseFromString(await resp.text(), 'text/html');
    return parseMeta(doc);
}

about

@bobheadxi/metadata is a minimal-dependency library for pulling metadata from a given webpage. What seems to be the de facto standard for doing so, metascraper, is so elaborate that there appears to be no intention for supporting browser environments, and much to my suprise I was unable to find a semi-robust library that would work in browsers. So I hacked this together.

0.1.6

1 year ago

0.1.5

3 years ago

0.1.2

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago