# abi-rpc

> An abstract bidirectional RPC framework.

Latest version **0.0.2** (published 2022-06-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install abi-rpc
pnpm add abi-rpc
yarn add abi-rpc
bun add abi-rpc
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-06-06 |
| First published | 2022-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | System233 |
| Maintainers | system233 |
| Keywords | abstract, bidirectional, RPC, framework |

## Links

- npm: https://www.npmjs.com/package/abi-rpc
- Repository: https://github.com/System233/abi-rpc
- Homepage: https://github.com/System233/abi-rpc#readme
- Issues: https://github.com/System233/abi-rpc/issues
- npm.io page: https://npm.io/package/abi-rpc

## Dependencies (1)

- [nanoid](https://npm.io/package/nanoid.md) ^3.3.4

## Recent versions

- 0.0.2 (latest) — 2022-06-06
- 0.0.1 — 2022-06-06

## README

<!--
 Copyright (c) 2022 System233
 
 This software is released under the MIT License.
 https://opensource.org/licenses/MIT
-->

# ABI-RPC

An abstract bidirectional RPC framework.

## Easy to use
```ts
class ServerHander {
    say(message: string) {
        console.log('message from client:', message)
    }
    echo(message:string){
        console.log('echo:', message)
        return message;
    }
}
class ClientHander {
    test(message: string) {
        console.log('message from server :', message)
    }
}
let server:ABIRPC<ClientHander>;

const client = new ABIRPC<ServerHander>(x=>server.handle(x), new ClientHander);

server = new ABIRPC<ClientHander>(x=>client.handle(x), new ServerHander);
server.call('test', 'hello');
client.call('say', 'say message');
client.call('echo', 'echo message').then(x=>console.log('echo result',x));

```

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