2.7k stars · MIT · v5.51.0 (2026-06-16), read from the About sidebar on the repository page · Track this in Scout
Reads a page's title, description, image, author, date and publisher out of Open Graph, Twitter Cards, JSON-LD, Microdata, RDFa and plain HTML, in a set order of preference.
▶Repo detailsthe review · specs · pros & cons · install
What it is
A JavaScript library that extracts a page's title, description, image, author, date and publisher from Open Graph tags, Twitter Cards, JSON-LD, Microdata, RDFa and the plain HTML, in a defined order of preference. It is built as small rule packs, so you install only the pieces you want.What it is good for. Anyone whose product accepts a link from a person. The problem it removes is that no two websites describe themselves the same way, and writing that guesswork yourself takes a week and never finishes. For Grasppy, where somebody pastes a link and expects a card, this fills in the title and the picture before any of the heavy reading starts. Edition 17 gave you astro-og-canvas (#7), which makes those preview pictures for your own pages. This one reads other people's.
- It checks six sources and falls back sensibly, so it still returns something useful on a badly built page.
- MIT licence, small, and a library rather than a service you have to pay for or run.
- You choose only the rule packs you need, so it stays light in your project.
- JavaScript and Node.js only. A Python backend needs a small service beside it, or a different tool.
- It reads the HTML it is handed and does not run the page's own code, so a page built entirely in the browser returns almost nothing.
- You still have to fetch the page yourself, and fetching links a stranger gave you is its own security job. Set a timeout and a size limit.
- mozilla/readability
Pulls out the readable article body rather than the summary card fields, so it answers what the page says where metascraper answers how the page describes itself.
Track this in Scout
adbar/trafilaturaThe same extraction job for Python instead of JavaScript, covering both text and metadata, and it can crawl a site as well.
Track this in Scout
firecrawl/firecrawlDoes the fetching as well as the extraction, as a service you run or pay for, which is far more than a library and far more to operate.
Track this in Scout
# Needs Node.js 18 or newer
npm install metascraper \
metascraper-title \
metascraper-description \
metascraper-image \
metascraper-url
# A minimal use, in a file called preview.mjs:
cat > preview.mjs <<'EOF'
import createMetascraper from 'metascraper'
import title from 'metascraper-title'
import description from 'metascraper-description'
import image from 'metascraper-image'
const scraper = createMetascraper([title(), description(), image()])
const targetUrl = process.argv[2]
const html = await (await fetch(targetUrl)).text()
console.log(await scraper({ html, url: targetUrl }))
EOF
node preview.mjs https://example.com
