# peer-request

> A meta-class for peer-to-peer-requests using symetric protocols.

Latest version **0.1.2** (published 2017-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install peer-request
pnpm add peer-request
yarn add peer-request
bun add peer-request
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2017-08-27 |
| First published | 2017-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Maciej Krüger |
| Maintainers | mkg20001 |
| Keywords | peer-request, protocols, symetric |

## Links

- npm: https://www.npmjs.com/package/peer-request
- Repository: https://github.com/mkg20001/peer-request
- Homepage: https://github.com/mkg20001/peer-request#readme
- Issues: https://github.com/mkg20001/peer-request/issues
- npm.io page: https://npm.io/package/peer-request

## Recent versions

- 0.1.2 (latest) — 2017-08-27
- 0.1.1 — 2017-08-27
- 0.1.0 — 2017-08-27
- 0.0.1 — 2017-07-06

## README

# peer-request
A meta-class for peer-to-peer-requests using symetric protocols.

# Usage
`new PeerRequest(name, inputDefinition, outputDefinition, validationFunction)`

The validation function will be called with the incoming/outgoing data and it's definition.

`sendRequest(send, data, cb)`
  - `send`: The function that will handle sending the request
  - `data`: The data to send in the request
  - `cb`: The callback that will be called with an error or result

`handleRequest(respond, data, handler)`
  - `respond`: The function that will handle sending the results
  - `date`: The data the other peer sent
  - `handler`: The function that will be passed the data and a callback

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