npm.io
8.1.0 • Published 2 weeks ago

@verdaccio/search-indexer

Licence
MIT
Version
8.1.0
Deps
2
Size
26 kB
Vulns
0
Weekly
0
Stars
17.8K

@verdaccio/search-indexer - Verdaccio Search Indexer

Verdaccio Home MIT License Verdaccio Latest This Package Latest

Documentation Discord Bluesky Backers Sponsors

Verdaccio Downloads Docker Pulls GitHub Stars

Note: This package is mostly for internal use by Verdaccio and is only intended to be used with Verdaccio 6.x.

Overview

The @verdaccio/search-indexer package provides an in-memory full-text search index for packages using the Orama search engine. It indexes package name, description, version, keywords, and author for fast search queries.

Installation

npm install @verdaccio/search-indexer

Usage

import { SearchMemoryIndexer } from '@verdaccio/search-indexer';

const indexer = new SearchMemoryIndexer();

// Configure storage reference
indexer.configureStorage(storage);

// Index a package
await indexer.add(packageMetadata);

// Search for packages
const results = await indexer.query('express');

// Search all packages
const all = await indexer.query('*');

// Remove a package from the index
await indexer.remove('my-package');

// Reindex all packages from storage
await indexer.reindex();
API

The SearchMemoryIndexer class provides:

  • configureStorage(storage) - Sets the storage reference for reindexing
  • query(term) - Searches the index by keyword. Use '*' to return all indexed packages
  • add(pkg) - Indexes a package with its name, description, version, keywords, and author
  • remove(name) - Removes a package from the index
  • reindex() - Forces a full reindex of all packages from storage

Donations

Verdaccio is run by volunteers; nobody is working full-time on it. If you find this project to be useful and would like to support its development, consider making a donation - your logo might end up in this readme.

Donate starting from $1/month or just one single contribution.

Report a vulnerability

If you want to report a security vulnerability, please follow the steps which we have defined for you in our security policy.

Open Collective Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor

Open Collective Backers

Thank you to all our backers! [Become a backer]

backers

Special Thanks

Thanks to the following companies to help us to achieve our goals providing free open source licenses.

jetbrains crowdin

Contributors

This project exists thanks to all the people who contribute. [Contribute].

contributors

FAQ / Contact / Troubleshoot

If you have any issue you can try the following options. Do not hesitate to ask or check our issues database. Perhaps someone has asked already what you are looking for.

License

Verdaccio is MIT licensed

The Verdaccio documentation and logos (excluding /thanks, e.g., .md, .png, .sketch files within the /assets folder) are Creative Commons licensed.

Keywords