mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
3ad519f0c2
* chore: upload gatsby website * chore: update header * chore: add background header * chore: add ci for website * Update ci-website.yml * chore: update patch mach ci * chore: update ci settings * chore: update docker version
45 lines
1010 B
Markdown
45 lines
1010 B
Markdown
---
|
|
id: node-api
|
|
title: "Node API"
|
|
---
|
|
|
|
Verdaccio can be invoked programmatically. The node API was introduced after version `verdaccio@3.0.0`.
|
|
|
|
## Usage
|
|
|
|
<div id="codefund">''</div>
|
|
|
|
#### Programmatically
|
|
|
|
```js
|
|
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
|
|
|
|
* [verdaccio-server](https://github.com/boringame/verdaccio-server) local npm registry proxy server
|
|
|
|
```js
|
|
// 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();
|
|
```
|