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 🙏

© 2025 – Pkg Stats / Ryan Hefner

astro-opengraph-image

v0.2.2

Published

(hopefully) the easiest way to generate OpenGraph images from your astro site

Readme

astro-opengraph-image

(hopefully) the easiest way to generate OpenGraph images from your Astro site

Define your OpenGraph image with HTML/CSS, inline in your Astro components.

the Astro toolbar with a preview of an OpenGraph image

Getting Started

# First, run this command to install the integration:
npx astro add astro-opengraph-image

# Next, you will want one or more fonts to use in your images,
# I like the fonts available at https://www.npmjs.com/org/fontsource, e.g.:
npm install @fontsource/inter
// Then, update your astro.config.{mjs|ts} file to configure the integration:
import { defineConfig } from "astro/config";
import opengraphImage from "astro-opengraph-image";
import { readFile } from "node:fs/promises";

export default defineConfig({
  integrations: [
    opengraphImage({
      // what color do you want your background to be?
      background: "#000000",

      // what size do you want your images to be?
      // 1200x630 is a good default across platforms,
      // and 3x scale is a convenient choice.
      width: 1200,
      height: 630,
      scale: 3,

      // the fonts you picked before. you will have to include the particular
      // weights and variants you want to use.
      fonts: [
        {
          name: "Inter",
          data: await readFile(
            "node_modules/@fontsource/inter/files/inter-latin-400-normal.woff",
          ),
          style: "normal",
          weight: 400,
        },
        {
          name: "Inter",
          data: await readFile(
            "node_modules/@fontsource/inter/files/inter-latin-700-normal.woff",
          ),
          style: "normal",
          weight: 700,
        },
      ],
    }),
  ],
});
---
// Lastly, inside your <head>, render the OgImage component to
// specify what you want in your image:

import { OgImage } from "astro-opengraph-image/components";
---

<!doctype html>
<html>
  <head>
    ...
    <OgImage>
      <h1>the page</h1>
      <p>this is the page</p>
      <style is:inline>
        h1 {
          color: red;
        }
      </style>
    </OgImage>
    ...
  </head>
  <body>...</body>
</html>

[!NOTE]

Your image is only influenced by code inside the <OgImage> tag. This means all relevant styles must live inside the tag.

Additionally, your styles must always have the is:inline attribute to convince Astro not to modify or hoist them.

[!NOTE]

astro-opengraph-image uses the Satori HTML layout engine and therefore supports the subset of HTML/CSS that Satori implements.