2024-03-10 11:58:39 -05:00
# Verdaccio Search API
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
The **Search** class in Verdaccio provides a convenient API for searching packages across both configured proxies and local storage. It enables efficient package discovery and retrieval by aggregating search results from multiple upstream sources.
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
## Installation
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
```bash
npm install @verdaccio/search
```
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
## Usage
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
```ts
import { Config } from '@verdaccio/config';
import { logger } from '@verdaccio/logger';
import { Search } from '@verdaccio/search';
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
const config = new Config(configYaml);
// Instantiate Search class
const search = new Search(config, logger);
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
// Define search parameters
const searchParams = {
// specify search parameters as needed
};
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
// Perform a search and retrieve the results
const searchResults = await search.search(searchParams);
```
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
## Donations
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
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.** 😉
2021-02-11 11:51:53 -05:00
2024-03-10 11:58:39 -05:00
**[Donate](https://opencollective.com/verdaccio)** 💵👍🏻 starting from _\$1/month_ or just one single contribution.
2021-02-11 11:51:53 -05:00
### License
Verdaccio is [MIT licensed ](https://github.com/verdaccio/verdaccio/blob/master/LICENSE )
The Verdaccio documentation and logos (excluding /thanks, e.g., .md, .png, .sketch) files within the /assets folder) is
[Creative Commons licensed ](https://github.com/verdaccio/verdaccio/blob/master/LICENSE-docs ).