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

@innotekseo/blogs-core

v0.1.1

Published

Content adapter library and REST API for Astro blog systems

Readme

@innotekseo/blogs-core

Content adapter library and REST API for Astro blog systems — supports local files, Strapi, and Contentful.

Part of the Innotek Platform Toolkits — open-source tools for AI-era content discoverability.

GitHub: innotekseoai/innotekseo-blogs · packages/core

Install

npm install @innotekseo/blogs-core

Requires: Node.js 20+

What it does

Provides a unified ContentAdapter interface for fetching blog content from any source, a ContentService wrapper, a Hono-based REST API server, RSS feed generation, and client-side search indexing.

Quick Start

import { LocalAdapter, ContentService } from "@innotekseo/blogs-core";

const adapter = new LocalAdapter("./src/content/posts");
const service = new ContentService(adapter);

const posts = await service.getPosts();
const post = await service.getPost("hello-world");

Export Paths

@innotekseo/blogs-core                      → ContentService, all adapters, types, RSS, search
@innotekseo/blogs-core/adapters/local       → LocalAdapter
@innotekseo/blogs-core/adapters/strapi      → StrapiAdapter
@innotekseo/blogs-core/adapters/contentful  → ContentfulAdapter
@innotekseo/blogs-core/rss                  → generateRss()
@innotekseo/blogs-core/search               → buildSearchIndex(), searchIndex()
@innotekseo/blogs-core/server               → createApi(), startServer(), validateMarkdown()

Adapters

LocalAdapter — filesystem .md/.mdx

import { LocalAdapter } from "@innotekseo/blogs-core/adapters/local";

const adapter = new LocalAdapter("./src/content");
const posts = await adapter.getPosts();
const post = await adapter.getPost("hello-world");

// With custom TTL cache
const adapter = new LocalAdapter("./src/content", { cacheTtlMs: 10000 });

StrapiAdapter — Strapi CMS (read-only)

import { StrapiAdapter } from "@innotekseo/blogs-core/adapters/strapi";

const adapter = new StrapiAdapter({
  url: process.env.STRAPI_URL,
  token: process.env.STRAPI_TOKEN,
});

ContentfulAdapter — Contentful CMS (read-only)

import { ContentfulAdapter } from "@innotekseo/blogs-core/adapters/contentful";

const adapter = new ContentfulAdapter({
  spaceId: process.env.CONTENTFUL_SPACE_ID,
  accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
  contentType: "blogPost",
});

ContentAdapter Interface

Implement this interface to add any content source:

interface ContentAdapter {
  getPosts(): Promise<PostMeta[]>;
  getPost(slug: string): Promise<Post>;
  getAllTags(): Promise<string[]>;
  getPostsByTag(tag: string): Promise<PostMeta[]>;
  savePost(slug: string, content: string): Promise<SaveResult>;
  deletePost(slug: string): Promise<DeleteResult>;
  postExists(slug: string): Promise<boolean>;
}

REST API Server

Built with Hono:

import { startServer } from "@innotekseo/blogs-core/server";
import { LocalAdapter } from "@innotekseo/blogs-core/adapters/local";

startServer({
  adapter: new LocalAdapter("./content"),
  port: 3001,
  apiKey: process.env.API_KEY,       // optional — protects write endpoints
  webhookUrl: process.env.WEBHOOK,   // optional — fires on content changes
  cors: true,
});

Endpoints:

| Method | Path | Description | |---|---|---| | GET | /api/posts | List posts (paginated, filterable by tag/search/sort) | | GET | /api/posts/:slug | Get post with full content | | POST | /api/posts | Create post (409 on duplicate slug) | | PUT | /api/posts/:slug | Update post | | DELETE | /api/posts/:slug | Delete post | | GET | /api/tags | List all tags | | GET | /api/tags/:tag | Posts by tag (paginated) | | GET | /api/health | Health check |

RSS Feed Generation

import { LocalAdapter, generateRss } from "@innotekseo/blogs-core";

const rss = await generateRss(new LocalAdapter("./content"), {
  title: "My Blog",
  description: "A blog about things",
  siteUrl: "https://example.com",
});
// Returns RSS 2.0 XML string

Client-Side Search

import { LocalAdapter, buildSearchIndex } from "@innotekseo/blogs-core";
import { searchIndex } from "@innotekseo/blogs-core/search";

// Build index at build time
const index = await buildSearchIndex(new LocalAdapter("./content"));

// Search at runtime (client-side)
const results = searchIndex(index, "astro tutorial");
// [{ post: { slug, title, ... }, score: 5 }, ...]

Data Types

interface PostMeta {
  slug: string;
  title: string;
  date: string;
  tags?: string[];
  description?: string;
  [key: string]: unknown;
}

interface Post extends PostMeta {
  content: string; // raw markdown body
}

Related Packages

| Package | Description | |---|---| | @innotekseo/cli | Main GEO/SEO CLI — llms.txt, article scaffolding | | @innotekseo/blogs-components | Astro UI components for MDX content | | @innotekseo/blogs-migrate | HTML-to-MDX migration CLI |

Innotek Platform Toolkits

License

ISC — Innotek Solutions Ltd