1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-08 23:25:51 +01:00
verdaccio/docs/node-api.md
Juan Picado @jotadeveloper e962e81a71
docs: update node api:
2018-01-21 10:12:17 +01:00

992 B

id title
node-api Node API

Verdaccio can be invoqued programmatically. The node API was introduced after version verdaccio@3.0.0-alpha.10.

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();