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

@yamblog/next

v1.2.0

Published

Next.js adapter for @yamblog/core

Readme

@yamblog/next

Next.js adapter for @yamblog/core. Metadata, JSON-LD, RSS, sitemap, OG images, and pre-built page components for the App Router.

Install

npm install @yamblog/core @yamblog/next

Setup

// lib/blog.ts
import { createBlog } from '@yamblog/core';
export const blog = createBlog({ contentDir: 'content/posts' });
export const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL ?? 'http://localhost:3000';

App Router usage

Blog listing page

// app/blog/page.tsx
import { BlogListPage } from '@yamblog/next';
import { blog } from '@/lib/blog';

export default async function Page({ searchParams }) {
  const { q } = await searchParams;
  const posts = q ? await blog.search(q) : await blog.getPosts();
  return <BlogListPage posts={posts} query={q} />;
}

Post detail page

// app/blog/[slug]/page.tsx
import { BlogPostPage } from '@yamblog/next';
import { generatePostMetadata, generateBlogJsonLd } from '@yamblog/next';
import { createStaticParams } from '@yamblog/next';
import { blog, SITE_URL } from '@/lib/blog';

export async function generateStaticParams() {
  return createStaticParams(blog);
}

export async function generateMetadata({ params }) {
  const post = await blog.getPostBySlug((await params).slug);
  return generatePostMetadata(post, { siteUrl: SITE_URL });
}

export default async function Page({ params }) {
  const post = await blog.getPostBySlug((await params).slug);
  const adjacent = await blog.getAdjacentPosts(post.slug);
  const related  = await blog.getRelatedPosts(post.slug);
  const jsonLd   = generateBlogJsonLd(post, { siteUrl: SITE_URL });
  return <BlogPostPage post={post} adjacent={adjacent} related={related} jsonLd={jsonLd} />;
}

RSS feed

// app/feed.xml/route.ts
import { createRssHandler } from '@yamblog/next';
import { blog, SITE_URL } from '@/lib/blog';
export const GET = createRssHandler(blog, { siteUrl: SITE_URL, title: 'My Blog', description: '...' });

Sitemap

// app/sitemap.ts
import { createSitemapExport } from '@yamblog/next';
import { blog, SITE_URL } from '@/lib/blog';
export default createSitemapExport(blog, { siteUrl: SITE_URL });

OG image

// app/blog/[slug]/opengraph-image/route.tsx
import { createOgImageHandler } from '@yamblog/next';
import { blog } from '@/lib/blog';
export const GET = createOgImageHandler(blog, { siteName: 'My Blog' });

Breadcrumb JSON-LD

import { generateBreadcrumbJsonLd } from '@yamblog/next';

const breadcrumbs = generateBreadcrumbJsonLd([
  { name: 'Home', url: 'https://example.com' },
  { name: 'Blog', url: 'https://example.com/blog' },
  { name: post.title, url: `https://example.com/blog/${post.slug}` },
]);

API

| Export | Description | |--------|-------------| | BlogListPage | Pre-built listing component with search | | BlogPostPage | Pre-built post detail component (markdown, prev/next, related) | | generatePostMetadata(post, opts) | Next.js Metadata with OpenGraph + Twitter cards. opts: { siteUrl, siteName?, basePath? } (basePath default /blog) | | generateBlogJsonLd(post, opts) | JSON-LD Article schema. opts: { siteUrl, basePath? } | | generateBreadcrumbJsonLd(items) | JSON-LD BreadcrumbList schema | | createStaticParams(blog) | generateStaticParams helper returning { slug }[] | | createRssHandler(blog, opts) | Route handler for RSS feed | | createSitemapExport(blog, opts) | Next.js sitemap export — uses the blog's basePath unless overridden | | createOgImageHandler(blog, opts) | Route handler for OG images via @vercel/og |