verdaccio
Version:
A lightweight private npm proxy registry
36 lines (35 loc) • 1.34 kB
TypeScript
import { ConfigYaml } from '@verdaccio/types';
/**
* Build the Express app from a raw config by reusing @verdaccio/server's
* composition (defineAPI), but inject 7.x's Storage so legacy callback storage
* plugins keep working. Exposed for tests that need the app without a listener.
*/
export declare function endPointAPI(configHash: ConfigYaml): Promise<any>;
/**
* Server factory passed to @verdaccio/node-api / @verdaccio/cli: maps the
* deprecated `logs` config key then builds the app with 7.x's legacy-aware
* Storage (via {@link endPointAPI}).
*/
export declare function startServer(config: ConfigYaml): Promise<any>;
/**
* Exposes a server factory to be instantiated programmatically.
*
```ts
const app = await runServer(); // default configuration
const app = await runServer('./config/config.yaml');
const app = await runServer({ configuration });
app.listen(4000, (event) => {
// do something
});
```
* @param config
*/
export declare function runServer(config?: string | ConfigYaml): Promise<any>;
/**
* Start the server on the port defined (or the port defined in the config file)
* @param config
* @param port
* @param version
* @param pkgName
*/
export declare function initServer(config: ConfigYaml, port: string | void, version: string, pkgName: string): Promise<void>;