mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
22 lines
394 B
Markdown
22 lines
394 B
Markdown
|
---
|
||
|
id: node-api
|
||
|
title: "Node API"
|
||
|
---
|
||
|
|
||
|
Verdaccio can be invoqued programmatically.
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
#### 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');
|
||
|
});
|
||
|
});
|
||
|
```
|