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

@macklinu/effect-og

v0.2.0

Published

A module for working with Open Graph metadata in Effect

Readme

@macklinu/effect-og

A module for working with Open Graph metadata in Effect

Installation

pnpm add @macklinu/effect-og

Peer dependencies:

  • effect@^3.19.0
  • react@^19 (optional; needed if using @macklinu/effect-og/react).

Usage

Website metadata

import * as Effect from 'effect/Effect'

import { Og } from '@macklinu/effect-og'

const program = Effect.gen(function* () {
  const metadata = yield* Og.makeWebsite({
    title: 'My Website',
    url: 'https://example.com',
    description: 'A website about things',
    siteName: 'Example',
    image: {
      url: 'https://example.com/og.png',
      width: 1200,
      height: 630,
      alt: 'Example website',
    },
  })

  // Get plain meta tag data (framework-agnostic)
  const tags = Og.toMetaTags(metadata)
  // [{ property: "og:type", content: "website" },
  //  { property: "og:title", content: "My Website" }, ...]
})

Article metadata

import * as DateTime from 'effect/DateTime'
import * as Effect from 'effect/Effect'

import { Og } from '@macklinu/effect-og'

const program = Effect.gen(function* () {
  const article = yield* Og.makeArticle({
    title: 'How to Use Effect',
    url: 'https://example.com/blog/effect',
    publishedTime: DateTime.unsafeMake('2025-12-20'),
    author: [
      'https://example.com/authors/macklinu',
      'https://example.com/authors/other',
    ],
    section: 'Technology',
    tags: ['effect', 'typescript'],
    image: [
      {
        url: 'https://example.com/blog/effect/og.png',
        width: 1200,
        height: 630,
      },
      {
        url: 'https://example.com/blog/effect/og-2.png',
        width: 800,
        height: 600,
      },
    ],
  })
})

Twitter Card metadata

Og.withTwitter attaches Twitter Card meta tags to any OgData value. Only card is required - Twitter falls back to og:title, og:description, and og:image automatically, so you only need to add extra fields to explicitly override those.

import * as Effect from 'effect/Effect'

import { Og } from '@macklinu/effect-og'

const program = Effect.gen(function* () {
  // data-first
  const data = yield* Og.makeWebsite({ ... })
  const withCard = yield* Og.withTwitter(data, { card: 'summary_large_image' })

  // data-last (pipeable)
  const withCard = yield* Og.makeArticle({ ... }).pipe(
    Effect.flatMap(
      Og.withTwitter({ card: 'summary', site: '@example' })
    )
  )

  Og.toMetaTags(withCard)
  // [...og tags...,
  //  { property: "twitter:card", content: "summary" },
  //  { property: "twitter:site", content: "@example" }]
})

Rendering to React

import { MetaTags } from '@macklinu/effect-og/react'

// Inside a React component or framework that supports <head> injection

;<MetaTags of={article} />
// Renders: <meta property="og:type" content="article" />
//          <meta property="og:title" content="How to Use Effect" />
//          <meta name="twitter:card" content="summary" />
//          ...

Supported types

| OG type | Constructor | | --------- | ------------------ | | website | Og.makeWebsite() | | article | Og.makeArticle() |

Both constructors return Effect<T, ParseError, never>, validating inputs and surfacing any issues as typed ParseError values in the error channel.

API

| Export | Description | | ------------------------ | ---------------------------------------------------------- | | Og.makeWebsite(input) | Construct validated website metadata | | Og.makeArticle(input) | Construct validated article metadata | | Og.withTwitter(input) | Attach Twitter Card tags to an OgData value (dual) | | Og.toMetaTags(data) | Convert metadata to ReadonlyArray<{ property, content }> | | Og.Article | Effect Schema class for article metadata | | Og.WebsiteMetadata | Effect Schema class for website metadata | | Og.Twitter | Effect Schema class for Twitter Card metadata | | <MetaTags of={data} /> | React component (@macklinu/effect-og/react) |