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

@karaoke-cms/enrich

v0.18.1

Published

AI enrichment pipeline for karaoke-cms

Readme

@karaoke-cms/enrich

AI enrichment pipeline for karaoke-cms. Reads published vault content and writes AI-generated metadata (reading_time, tags, description, related) back into frontmatter.

Usage

CLI

# Enrich all published files in your vault
KARAOKE_VAULT=./my-vault karaoke-enrich

# Enrich only specific files (e.g. from a git pre-commit hook)
karaoke-enrich --staged path/to/post.md another/post.md

Library

import { run, defineProvider } from '@karaoke-cms/enrich'

// Use a built-in provider (reads API key from env)
const result = await run({ vault: '/absolute/path/to/vault' })
console.log(`Enriched ${result.enriched} files, wrote ${result.written}`)

// Use a custom provider — no API key required
const myProvider = defineProvider({
  async enrich(body) {
    return { tags: ['custom'], description: 'Custom description.' }
  }
})

const result = await run({ vault: '/path/to/vault', provider: myProvider })

Configuration

All options can be passed to run() or set via environment variables:

| Option | Env var | Default | |---|---|---| | vault | KARAOKE_VAULT | — (required) | | provider | ENRICH_PROVIDER | 'openai' | | maxEnrich | MAX_ENRICHMENTS_PER_RUN | 20 | | relatedMax | RELATED_MAX | 3 | | dryRun | DRY_RUN | false | | cachePath | ENRICH_CACHE_PATH | {cwd}/.enrich-cache.json | | stagedFiles | — | null (all files) |

What it does

For each published Markdown file that hasn't been enriched yet (or whose body has changed):

  1. Title — generates a title for untitled documents, writes title
  2. Reading time — counts words, writes reading_time in minutes
  3. Tags — asks the AI for 3–6 tags, writes tags array
  4. Description — asks the AI for a 20–30 word summary, writes description
  5. Related posts — computes tag overlap across all posts, writes related (slugs)

Results are cached in .enrich-cache.json (gitignored) — unchanged files are skipped. A per-run cap prevents runaway API costs.

Privacy gate: only processes files with publish: true. Private vault notes are never sent to an AI provider.

Custom providers

Any object with an enrich(body) method works as a provider:

import { run, defineProvider } from '@karaoke-cms/enrich'

const llamaProvider = defineProvider({
  async enrich(body) {
    const result = await callYourLlama(body)
    return { tags: result.keywords, description: result.summary }
  }
})

await run({ vault: '/path/to/vault', provider: llamaProvider })

Built-in providers (openai, anthropic) are also importable directly:

import { enrich } from '@karaoke-cms/enrich/providers/openai'
import { enrich, parseEnrichResponse } from '@karaoke-cms/enrich/providers/anthropic'

Pre-commit hook

Add to .githooks/pre-commit (or wherever your project configures hooks):

#!/usr/bin/env zsh
staged_md=("${(@f)$(git diff --cached --name-only | grep '\.md$' || true)}")
[[ ${#staged_md[@]} -eq 0 ]] && exit 0
[[ -z "${OPENAI_API_KEY:-}" && -z "${ANTHROPIC_API_KEY:-}" ]] && exit 0

pnpm exec karaoke-enrich --staged "${staged_md[@]}" || true
git add "${staged_md[@]}" .enrich-cache.json

What's new in 0.18.0

  • AI-generated titles -- untitled documents now receive an AI-generated title in frontmatter, so every published page has a meaningful heading without manual effort.
  • Shorter descriptions -- the description field now targets 20--30 words instead of longer summaries, producing tighter copy for meta tags and link previews.

What's new in 0.17.0

No user-facing changes in this release.

Return value

run() returns a structured result:

{
  enriched: number   // files where the AI provider was called
  written:  number   // files written to disk
  skipped:  number   // files skipped (cache hit, no change needed)
  errors:   Array<{ path: string, error: Error }>
}