npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

satteri-link-card

v0.4.2

Published

Build-time link cards for Sätteri Markdown.

Readme

🌌 satteri-link-card

A Sätteri HAST plugin that turns a standalone URL into a link card at build time.

[!WARNING] This package is experimental. Its API, generated HTML, CSS class names, and behavior may change incompatibly between releases.

View live examples.

✨ Features

  • Resolves Open Graph, Twitter Card, and standard HTML metadata
  • Displays a title, description, hostname, favicon, and thumbnail when available
  • Caches metadata locally by default
  • Optionally caches thumbnails and favicons as public assets
  • Leaves the original link unchanged when metadata cannot be resolved
  • Provides optional preset CSS without injecting styles

📦 Installation

pnpm add satteri-link-card satteri

Node.js 22 or newer is required.

🚀 Sätteri setup

import { markdownToHtml } from "satteri";
import { satteriLinkCard } from "satteri-link-card";

const result = await markdownToHtml("https://example.com/article", {
  hastPlugins: [satteriLinkCard()],
});

Only a bare HTTP or HTTPS URL in a root-level paragraph is converted. Explicit Markdown links, inline URLs, and URLs nested in lists or blockquotes are left unchanged.

🌌 Astro setup

Install the Astro processor and configure it in astro.config.mjs:

pnpm add @astrojs/markdown-satteri satteri satteri-link-card
import { satteri } from "@astrojs/markdown-satteri";
import { defineConfig } from "astro/config";
import { satteriLinkCard } from "satteri-link-card";

export default defineConfig({
  markdown: {
    processor: satteri({
      hastPlugins: [satteriLinkCard()],
    }),
  },
});

The plugin then processes Markdown rendered by Astro.

🎨 Styling

The plugin emits class names but does not inject CSS. Import the optional preset once from a shared Astro layout or another global stylesheet entry:

---
import "satteri-link-card/preset.css";
---

You can omit the preset and define the styles yourself. The generated elements use these stable classes for the current release:

  • .satteri-link-card
  • .satteri-link-card__body
  • .satteri-link-card__title
  • .satteri-link-card__description
  • .satteri-link-card__meta
  • .satteri-link-card__host
  • .satteri-link-card__favicon
  • .satteri-link-card__media
  • .satteri-link-card__image

⚙️ Options

satteriLinkCard({
  metadataCache: {
    directory: ".cache/satteri-link-card",
    maxAge: 30 * 24 * 60 * 60 * 1000,
  },
  imageCache: true,
  thumbnail: { position: "right" },
  favicon: false,
  shortenUrl: true,
  ignoreExtensions: [".pdf", ".mp4"],
  openInNewTab: true,
});

| Option | Default | Description | | -------------------------- | -------------------------- | ------------------------------------------------------------------- | | metadataCache | {} | Metadata cache settings, or false to disable the cache. | | metadataCache.directory | .cache/satteri-link-card | Directory for cached metadata files. | | metadataCache.maxAge | 30 days | Maximum age in milliseconds, or false to never expire. | | imageCache | false | Enables the filesystem image cache or accepts custom store options. | | imageCache.maxImageBytes | 5 MiB | Maximum download size for one cached image. | | thumbnail | { position: "right" } | Sets the thumbnail position; use false to omit it. | | favicon | enabled | Use false to omit favicon discovery and rendering. | | shortenUrl | true | Shows only the hostname instead of the full URL. | | ignoreExtensions | [] | Leaves URLs with matching path extensions unchanged. | | transformMetadata | undefined | Changes resolved metadata before rendering and asset caching. | | openInNewTab | true | Adds target="_blank" and rel="noopener noreferrer". |

💾 Image cache

imageCache: true writes thumbnails and favicons to public/satteri-link-card/ and renders them from /satteri-link-card/.

Use the built-in store to change the filesystem location:

import { createFileSystemImageCacheStore, satteriLinkCard } from "satteri-link-card";

satteriLinkCard({
  imageCache: {
    store: createFileSystemImageCacheStore({
      directory: "static/link-cards",
      publicPath: "/link-cards",
    }),
  },
});

Custom backends can implement the exported ImageCacheStore interface. The initial cache supports common raster formats and ICO favicons. SVG assets are not cached. Image-cache failures fall back to the remote asset URL.

🔒 Security and limitations

Metadata and image requests run in the build environment. Use the plugin only with trusted Markdown. Requests to private or local network addresses are not currently blocked.

The plugin does not provide offline builds, cache pruning, or concurrency limits across different URLs.

🔁 Relationship to remark-link-card-plus

This package is inspired by remark-link-card-plus, but the packages are not interchangeable:

  • remark-link-card-plus is a Remark/mdast plugin; this package is a Sätteri HAST plugin.
  • Option names and configuration structures differ.
  • Metadata caching and image caching are separate in this package.

🛠️ Development

vp install
vp check
vp test
vp pack

📄 License

MIT