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

@meeovi/search

v1.0.3

Published

Powerful search module for the Alternate Framework.

Readme

@meeovi/search

A modular, provider-agnostic search module for the Alternate Framework. It provides a unified, typed search API with pluggable adapters (Meilisearch, OpenSearch, mock adapters), a small CLI for indexing/warmup, and event hooks.

Features

  • Plug-and-play adapters (Meilisearch, OpenSearch, Mock)
  • Fully typed integration with @meeovi/core
  • Mock adapter for tests
  • Small CLI for indexing and warmup
  • Configuration validation and event hooks (search:query, search:results)

Installation

Using npm:

npm install @meeovi/search

Using pnpm:

pnpm add @meeovi/search

Quick Usage

Register the module with an Alternate app:

import { createAlternateApp } from '@meeovi/core'
import searchModule from '@meeovi/search'

const app = createAlternateApp({
  config: {
    search: {
      defaultProvider: 'meilisearch',
      providers: {
        meilisearch: {
          host: 'http://localhost:7700',
          index: 'products',
          apiKey: 'masterKey'
        }
      }
    }
  },
  modules: [searchModule]
})

await app.start()

const search = app.context.getAdapter('search')
const results = await search.search({ term: 'shoes' })
console.log(results.items)

Adapters

Meilisearch adapter:

import { createMeilisearchAdapter } from '@meeovi/search'

const adapter = createMeilisearchAdapter({
  host: 'http://localhost:7700',
  index: 'products',
  apiKey: 'masterKey'
})

OpenSearch adapter:

import { createOpenSearchAdapter } from '@meeovi/search'

const adapter = createOpenSearchAdapter({
  endpoint: 'https://my-opensearch.com',
  index: 'products',
  apiKey: 'secret'
})

Mock adapter (for testing):

import { createMockSearchAdapter } from '@meeovi/search'

const mock = createMockSearchAdapter([
  { id: '1', title: 'Red Shoes' },
  { id: '2', title: 'Blue Shirt' }
])

const results = await mock.search({ term: 'red' })

Configuration

Example search config in your app:

{
  "search": {
    "defaultProvider": "opensearch",
    "providers": {
      "opensearch": {
        "endpoint": "https://my-opensearch.com",
        "index": "products"
      }
    }
  }
}

The module validates that defaultProvider and the referenced provider configuration exist, and that required fields for each adapter are present.

Events

This module emits bus events that you can listen to:

bus.on('search:query', ({ term }) => {
  console.log('User searched for:', term)
})

bus.on('search:results', ({ term, total }) => {
  console.log(`Search for "${term}" returned ${total} results`)
})

CLI

Included CLI commands:

  • Warmup: meeovi-search warmup
  • Index a JSON file: meeovi-search index ./products.json

Environment variables supported (example for Meilisearch):

  • SEARCH_PROVIDER=meilisearch
  • MEILI_HOST=http://localhost:7700
  • MEILI_INDEX=products
  • MEILI_KEY=masterKey

Testing

Use the mock adapter in tests to avoid external dependencies:

import { createMockSearchAdapter } from '@meeovi/search'

const mock = createMockSearchAdapter([{ id: '1', title: 'Test Product' }])
const results = await mock.search({ term: 'test' })

File structure

Typical layout:

@meeovi/search
├─ src/
│  ├─ index.ts
│  ├─ module.ts
│  ├─ adapter/
│  │  ├─ opensearch.ts
│  │  ├─ meilisearch.ts
│  │  ├─ mock.ts
│  │  └─ types.ts
│  ├─ config/schema.ts
│  ├─ events.ts
│  └─ utils/normalizers.ts
├─ cli.ts
├─ package.json
└─ README.md

License

MIT