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

ai-search-indexer

v1.0.2

Published

Website content indexer using Mozilla Readability and Playwright

Readme

ai-search-indexer

Index documentation websites into JSON artifacts that power the web components in this monorepo.

This package supports two index formats:

  • context.json for wg-doc-search (classic search + Prompt API answer)
  • vector-context.json for wg-rag-search (Orama + Transformers.js retrieval + Prompt API answer)

Install

pnpm add ai-search-indexer
npx playwright install chromium

Quick Start (Monorepo)

From repo root:

pnpm install

1. Create a Classic Index (context.json)

Example (Angular Material overview pages):

node packages/indexer/examples/index-angular-material.js

Output:

  • packages/web-components/demo/context.json

2. Create a Vector Index (vector-context.json)

Example (~50 Angular Material pages: overview + api):

node packages/indexer/examples/index-vector.js

Output:

  • packages/web-components/demo/vector-context.json

Programmatic API

WebsiteIndexer (classic)

import { WebsiteIndexer } from 'ai-search-indexer';

const indexer = new WebsiteIndexer('./context.json');
await indexer.indexUrls([
  'https://material.angular.dev/components/table/overview',
  'https://material.angular.dev/components/sort/overview'
]);
indexer.displayStats();

VectorDocIndexer (RAG)

import { VectorDocIndexer } from 'ai-search-indexer';

const indexer = new VectorDocIndexer('./vector-context.json', {
  embeddingModel: 'Xenova/all-MiniLM-L6-v2'
});

await indexer.indexUrls([
  'https://material.angular.dev/components/table/overview',
  'https://material.angular.dev/components/table/api'
]);

indexer.displayStats();

Vector CLI

Run from packages/indexer:

pnpm index:vector --output ./vector-context.json --urls-file ./urls.txt

You can also pass URLs directly:

pnpm index:vector \
  https://material.angular.dev/components/table/overview \
  https://material.angular.dev/components/table/api

CLI options

  • --urls-file <path>: .txt or .json URL list
  • --output <path>: output path (default ./vector-context.json)
  • --model <name>: embedding model (default Xenova/all-MiniLM-L6-v2)

Output Formats

context.json

Contains indexed_content pages with fields like:

  • url
  • title
  • description
  • content
  • html_content

vector-context.json

Contains:

  • metadata
  • pages[]
  • chunks[] with per-chunk embedding

Scripts

In packages/indexer/package.json:

  • pnpm example
  • pnpm example:vector
  • pnpm index:vector
  • pnpm test

Tutorial

See full step-by-step guide:

  • packages/indexer/TUTORIAL.md

License

MIT