0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-20 22:52:46 -05:00
verdaccio/website/docs/node-api.md
Abraham Schilling ddb42431d1 build: configure prettier as formatter for json, yaml and markdown (#1930)
* build: configure pretter as formatter for most files

* chore: reformat code (#1931)

* chore: re-format all files

* chore: force run quality anaylsis test

Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>

Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
2021-04-09 17:54:19 +02:00

1,003 B

id title
node-api Node API

Verdaccio can be invoked programmatically. The node API was introduced after version verdaccio@3.0.0.

Usage

''

Programmatically

import startServer from 'verdaccio';

startServer(configJsonFormat, 6000, store, '1.0.0', 'verdaccio', (webServer, addrs, pkgName, pkgVersion) => {
  webServer.listen(addr.port || addr.path, addr.host, () => {
    console.log('verdaccio running');
  });
});

Other implementations

// js
import * as verdaccioServer from 'verdaccio-server';
verdaccioServer.start();
verdaccioServer.stop();
verdaccioServer.list();
verdaccioServer.stopAll();
verdaccioServer.show();
verdaccioServer.cli();
// windows .net2
verdaccioServer.serviceInstall();
verdaccioServer.serviceUninstall();
verdaccioServer.serviceStart();
verdaccioServer.serviceStop();
verdaccioServer.serviceRestart();