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

best-blog-data

v0.9.0

Published

A powerful and lightweight npm package for working with structured blog post data, featuring 200+ dummy posts out of the box. Includes built-in pagination, categorization, fuzzy search, and full TypeScript support. Perfect for static blogs, CMS backends,

Downloads

15

Readme

📚 Best-blog-data

A powerful and lightweight npm package for working with structured blog post data, featuring 200+ dummy posts out of the box. Includes built-in pagination, categorization, fuzzy search, and full TypeScript support. Perfect for static blogs, CMS backends, or frontend demos.

[!NOTE] 😍 200+ Posts and 30 Categories with SEO Meta!

GitHub License GitHub last commit NPM Downloads NPM Version


✨ Features

  • 📄 Pagination – Retrieve posts with configurable page size and pagination
  • 🏷️ Category Filtering – Organize and access posts by categories
  • 🔍 Search – Fuzzy search powered by Fuse.js
  • 🔗 Post Slug Lookup – Quickly fetch posts by slug
  • 🧩 Modular API – Simple, composable utilities
  • Lightweight – Zero bloat, minimal dependencies
  • 🧠 Fully Typed – Built with TypeScript for great DX

📦 Installation

npm install best-blog-data

or

pnpm add best-blog-data

🚀 Quick Start

Create Instance

import BestBlogData from 'best-blog-data'

const blogData = new BestBlogData()

📄 Get Paginated Posts

const { posts, nextPageAvailable } = blogData.getPosts() // Defaults to page 1
console.log(posts.length) // Up to 10 posts
const page2 = blogData.getPosts(2)
console.log(page2.posts.length)

🔗 Get Full Post by Slug with HTML Content

const post = blogData.getFullPostBySlug('my-blog-post-slug')
if (post) {
  console.log(post.title)
}

🏷️ Filter Posts by Category

const { posts, nextPageAvailable, categoryFound } =
  blogData.getPostsByCategory('technology')
if (categoryFound) {
  console.log(posts)
}
const reactPostsPage2 = blogData.getPostsByCategory('react', 2)

📚 Get All Categories

const categories = blogData.getAllCategories()
console.log(categories)
// [
//   { slug: 'react', name: 'React' },
//   { slug: 'ai', name: 'Artificial Intelligence' },
//   ...
// ]

🔍 Fuzzy Search Posts

const searchResults = blogData.getPostsBySearch('AI content')
searchResults.forEach(({ item, score }) => {
  console.log(`${item.title} (score: ${score})`)
})

📘 API Reference

blogData.getPosts(pageIndex?: number): { posts: Post[], nextPageAvailable: boolean }

Returns paginated posts (10 per page by default).


blogData.getFullPostBySlug(slug: string): Post | undefined

Fetch a single post by its unique slug.


blogData.getPostsByCategory(categorySlug: string, pageIndex?: number): { posts: Post[], nextPageAvailable: boolean, categoryFound: boolean }

Retrieve posts filtered by a category slug.


blogData.getAllCategories(): Category[]

Returns a list of all unique categories found in posts.


blogData.getPostsBySearch(query: string): FuseResult<Post>[]

Performs fuzzy search across post titles. Returns max 10 results with match scores.


🧱 Data Structure

Post

interface Post {
  slug: string
  title: string
  content?: string
  date: string
  image: string
  categorie: {
    slug: string
    name: string
  }
  meta_seo: {
    title: string
    description: string
    image: string
    url: string
  }
}

Category

interface Category {
  slug: string
  name: string
}

🔧 Search Configuration (Fuse.js)

  • Threshold: 0.3
  • Search Keys: ['title']
  • Limit: 10 results

📦 Dependency


💡 Use Cases

  • Build static blog websites
  • Power blog UIs with real or mock content
  • CMS & content preview tools
  • Search-enabled article listings
  • Prototyping frontend blog layouts

🧠 TypeScript Support

This package is fully typed with built-in definitions, ensuring IntelliSense and compile-time safety in modern editors and TypeScript projects.


🤝 Contributing

Found a bug or have a feature idea? PRs and issues are welcome!

git clone https://github.com/devgauravjatt/best-blog-data

📄 License

MIT © devgauravjatt


🔍 Keywords

blog, cms, posts, pagination, search, categories, typescript, fuse, content, npm-package