@verdaccio/local-storage
Version:
Local storage implementation
35 lines (34 loc) • 1.32 kB
TypeScript
import { searchUtils } from '@verdaccio/core';
/**
* Retrieve a list of absolute paths to all folders in the given storage path
* @param storagePath the base path of the storage
* @return a promise that resolves to an array of absolute paths
*/
export declare function getFolders(storagePath: string, pattern?: string): Promise<string[]>;
/**
* Search packages on the the storage. The storage could be
* - storage
* - pkg1
* - @company
* - pkg2 -> @scompany/pkg2
* - storage1
* - pkg2
* - pkg3
* - storage2
* - @scope
* - pkg4 > @scope/pkg4
* The search return a data structure like:
* [
* {
* name: 'pkg1', // package name could be @scope/pkg1
* path: absolute/path/package/name
* }
* ]
* @param {string} storagePath is the base path of the storage folder,
* inside could be packages, storages and @scope packages.
* @param {Set<string>} storages storages are defined peer package access pattern via `storage` property
* @param query is the search query from the user via npm search command.
* and are intended to organize packages in a tree structure.
* @returns {Promise<searchUtils.SearchItemPkg[]>}
*/
export declare function searchOnStorage(storagePath: string, storages: Map<string, string>): Promise<searchUtils.SearchItemPkg[]>;