# call.io

> A remote procedure call system through Socket.IO

Latest version **1.1.0** (published 2023-05-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install call.io
pnpm add call.io
yarn add call.io
bun add call.io
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2023-05-28 |
| First published | 2022-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Cédric Tailly |
| Maintainers | cedrictailly |
| Keywords | rpc, socketio |

## Links

- npm: https://www.npmjs.com/package/call.io
- Repository: https://github.com/cedrictailly/call.io
- Homepage: https://github.com/cedrictailly/call.io#readme
- Issues: https://github.com/cedrictailly/call.io/issues
- npm.io page: https://npm.io/package/call.io

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2023-05-28
- 1.0.2 — 2022-02-20
- 1.0.1 — 2022-02-20

## README

# Call.IO

[![npm version](https://badge.fury.io/js/take-easy.svg)](https://www.npmjs.com/package/call.io)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A remote procedure call (RPC) module through Socket.IO.

## Installation

```bash
npm install -s call.io
```

or :

```bash
yarn add call.io
```

## Usage

You can see a use case in `/example`, here is an example.

### Server side

```javascript

const server = require('http').createServer();
const io     = require('socket.io')(server);
const callio = require('callio');

const methods = {
  log: message => {
    console.log(message);
    return "Hello from server";
  },
  plusOne: value => value + 1
};

io.on('connection', socket => callio.publish(socket, "methods", methods));

server.listen(8080);

```

### Client side

```javascript

(async () => {

  const socket = require('socket.io-client')('http://127.0.0.1:8080/');
  const callio = require('callio');

  const { log, plusOne } = await callio.require(socket, "methods");

  console.log(await log("Hello from client"));
  console.log(await plusOne(10));

})();

```

## License

Call.IO is released under the MIT License. See LICENSE for more information.

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