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

docusaurus-theme-search-altor

v0.1.0

Published

Semantic search for Docusaurus, powered by altor-vec WASM

Readme

docusaurus-theme-search-altor

Fast client-side semantic search for Docusaurus, powered by altor-vec.

Install in under 5 minutes

1) Install the package

npm install docusaurus-theme-search-altor

2) Add the theme

// docusaurus.config.js
module.exports = {
  themes: ['docusaurus-theme-search-altor'],
};

3) Configure search

// docusaurus.config.js
module.exports = {
  themes: ['docusaurus-theme-search-altor'],
  themeConfig: {
    altorSearch: {
      searchPagePath: 'search',
      embeddingModel: 'all-MiniLM-L6-v2',
      embeddingApiUrl: 'https://cursor-worker.fly.dev',
      maxResultsPerQuery: 8,
      hnsw: {
        m: 16,
        efConstruction: 200,
        efSearch: 50,
      },
      placeholder: 'Search docs...',
      keyboardShortcut: true,
    },
  },
};

Build your site, ship the generated index, and search is ready. BM25 keyword search runs fully client-side. Semantic vector search requires a running embedding API to convert queries into vectors at search time.

Configuration reference

Theme config: themeConfig.altorSearch

| Option | Type | Default | Description | | --- | --- | --- | --- | | searchPagePath | string \| false | 'search' | Route for the built-in search page. Set to false to disable it. | | embeddingModel | string | 'all-MiniLM-L6-v2' | Embedding model name sent to your embedding service during index generation. | | embeddingApiUrl | string | 'https://cursor-worker.fly.dev' | HTTP endpoint for embedding generation. Used at build time (index creation) and at runtime (query embedding for semantic search). Must be accessible from both your CI and your users' browsers. A hosted instance is provided by default. | | maxResultsPerQuery | number | 8 | Maximum client-side results returned for each query. | | hnsw.m | number | 16 | HNSW graph connectivity parameter for index construction. | | hnsw.efConstruction | number | 200 | HNSW build-time candidate list size. | | hnsw.efSearch | number | 50 | HNSW search-time candidate list size. | | placeholder | string | 'Search docs...' | Placeholder text shown in the search trigger and modal input. | | keyboardShortcut | boolean | true | Enables the platform-aware open-search shortcut (⌘K on macOS, Ctrl K elsewhere). |

All public runtime configuration lives under themeConfig.altorSearch.

How it works

  1. During docusaurus build, the theme extracts your site content, calls the embedding API to generate vectors, and builds HNSW + BM25 indexes.
  2. The indexes are written into the built site as static assets (search/index.bin, search/metadata.json, search/bm25.json).
  3. In the browser:
    • BM25 keyword search runs fully client-side with zero external calls.
    • Semantic vector search sends the query to your embeddingApiUrl to get a vector, then searches the HNSW index client-side via altor-vec WASM.

The embedding API is required at both build time and runtime. You can host it yourself (see embed-api/ in the repo) or use any OpenAI-compatible embedding endpoint. If the API is unreachable, search gracefully degrades to BM25 keyword results only.

Comparison

| Feature | docusaurus-theme-search-altor | Algolia DocSearch | docusaurus-search-local | | --- | --- | --- | --- | | Runtime dependency | Embedding API for semantic search (BM25 works standalone) | Algolia SaaS | None beyond static assets | | Search quality | Hybrid BM25 + vector semantic search | Keyword search with hosted ranking | Local keyword search | | Setup time | Minutes if you already have an embedding API | Fast if you qualify for DocSearch, otherwise account setup required | Fast | | Offline/self-hosted runtime | Yes | No | Yes | | Privacy | Queries stay in the browser | Queries go to Algolia | Queries stay in the browser | | Best fit | Teams that want hybrid semantic + keyword search with a lightweight API | Teams that want a managed search product | Teams that only need local keyword search |

Powered by altor-vec

This package uses the altor-vec WASM vector engine for client-side semantic retrieval.

  • Main repo: https://github.com/Altor-lab/altor-vec

License

MIT