Navigator Prefabricating Marinates
Wondering what’s next for npm?Check out our public roadmap! »

@mainframe/rpc-nodeTypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

rpc-node

rpc-request or rpc-stream factory with automatic transport selection.

Installation

yarn add @mainframe/rpc-node

Usage

import nodeRPC from '@mainframe/rpc-node'
 
const rpcOverHTTP = nodeRPC('http://localhost') // RequestRPC using HTTP transport
const rpcOverWS = nodeRPC('ws://localhost') // StreamRPC using WebSocket transport
const rpcOverIPC = nodeRPC('/path/to/socket') // StreamRPC using ICP transport

API

nodeRPC()

Arguments

  1. endpoint: string: socket path, HTTP or WebSocket URL to connect to.

Returns RequestRPC (with HTTP endpoint) or StreamRPC (with IPC or WebSocket endpoint).

License

MIT

Keywords

none

Install

npm i @mainframe/rpc-node

DownloadsWeekly Downloads

6

Version

0.3.0

License

MIT

Unpacked Size

3.14 kB

Total Files

5

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar