# transparent-rpc

> Easy to use async RPC for node, based on promises. Similar in spirit to Java RMI

Latest version **1.1.0** (published 2021-06-28) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2021-06-28 |
| First published | 2018-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 115.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Giovanni Campagna |
| Maintainers | gcampax |
| Keywords | rpc, proxy |

## Links

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

## Recent versions

- 1.1.0 (latest) — 2021-06-28
- 1.0.0 — 2019-04-12
- 0.0.2 — 2019-02-12
- 0.0.1 — 2018-02-26

## README

# Transparent RPC

[![Build Status](https://travis-ci.com/stanford-oval/transparent-rpc.svg?branch=master)](https://travis-ci.com/stanford-oval/transparent-rpc) [![Coverage Status](https://coveralls.io/repos/github/stanford-oval/transparent-rpc/badge.svg?branch=master)](https://coveralls.io/github/stanford-oval/transparent-rpc?branch=master) [![Dependency Status](https://david-dm.org/stanford-oval/transparent-rpc/status.svg)](https://david-dm.org/stanford-oval/transparent-rpc) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/stanford-oval/transparent-rpc.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/stanford-oval/transparent-rpc/context:javascript)

Automatic Proxy-based RPC for Node.js

## How to use:

- Add `$rpcMethods` property to the prototype of the classes you want to export
- Create `rpc.Socket` object wrapping the transport layer (an object-mode stream supporting arbitrary objects)

  ````
  const rpc = require('transparent-rpc');
  let socket = new rpc.Socket(...);
  ````

- Publish the first stub object:

  ```
  let id = socket.addStub(mystub);
  ```

- Transmit the ID of the stub out of band
- Handle methods on the stub
- Objects received by the stub will be proxies
- Invoking a method on a proxy returns a promise for the execution of that method
- To publish more objects, return them from the stub's methods, or pass them them to remote proxy methods

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