# up4w-service

> A javaScript library run UP4W program to start UP4W p2p network

Latest version **0.2.8** (published 2023-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install up4w-service
pnpm add up4w-service
yarn add up4w-service
bun add up4w-service
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.8 |
| Published | 2023-08-09 |
| First published | 2023-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 35.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | up4w_devteam |
| Keywords | up4w, up4wjs, gpt4w |

## Links

- npm: https://www.npmjs.com/package/up4w-service
- Repository: https://github.com/up4w/up4w-js
- Homepage: https://github.com/up4w/up4w-js#readme
- Issues: https://github.com/up4w/up4w-js/issues
- npm.io page: https://npm.io/package/up4w-service

## Dependencies (8)

- [koffi](https://npm.io/package/koffi.md) ^2.3.19
- [minimist](https://npm.io/package/minimist.md) ^1.2.8
- [up4wjs-utils](https://npm.io/package/up4wjs-utils.md) *
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^5.0.0
- [up4wjs-errors](https://npm.io/package/up4wjs-errors.md) *
- [up4wjs-tsconfig](https://npm.io/package/up4wjs-tsconfig.md) *
- [up4wjs-providers](https://npm.io/package/up4wjs-providers.md) *
- [eslint-config-up4wjs](https://npm.io/package/eslint-config-up4wjs.md) *

## Recent versions

- 0.2.8 (latest) — 2023-08-09
- 0.2.7 — 2023-08-08
- 0.2.6 — 2023-08-07
- 0.2.5 — 2023-07-06
- 0.2.4 — 2023-06-12
- 0.2.3 — 2023-06-12
- 0.2.2 — 2023-06-09
- 0.2.1 — 2023-06-08
- 0.2.0 — 2023-05-29
- 0.1.5 — 2023-05-29

## README

## up4w-service

Detecting the system architecture at runtime, launching the corresponding underlying [`UP4W`](https://github.com/up4w/up4w-core/blob/master/docs/index.md) network. In Linux systems, it will run `up4w.so`, in macOS it will run `up4w.dylib`, and in Windows it will run `up4w.dll`.

```
import UP4WService from "up4w-service"
import UP4WJS from "up4w-js"

const service = new UP4WService()
async function start() {
  const resp = await service.run()
  const {
    availableEndpoint: { ws },
  } = resp
  // output: ws://127.0.0.1:52416/api
  // `52416` is a random port number.
  const up4w = new UP4WJS(ws)
  // do your stuff...
}
```

> [up4wjs](https://www.npmjs.com/package/up4w-js)

#### service.run()

Running the underlying `UP4W` program.

##### Parameters: none

##### Returns:

`Promise` resolved with a object

- availableEndpoint `object`
  - ws `string` Available websocket endpoint, with randomly assigned port number that may vary each time it is started
  - http `string` Available http endpoint, also with randomly assigned port number

---
_Source: https://npm.io/package/up4w-service · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
