OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-kb / skills / protomux-rpc / api-extract.json

52 lines · json ref:
{
  "repo": "protomux-rpc",
  "timestamp": "2026-01-16T23:56:13.429Z",
  "entryPoint": "index.js",
  "exports": {
    "packageJson": {
      "main": "index.js",
      "exports": {
        "./package": "./package.json",
        ".": "./index.js",
        "./errors": "./lib/errors.js"
      }
    }
  },
  "api": {
    "file": "index.js",
    "exports": [
      {
        "type": "default",
        "name": "class"
      }
    ],
    "classes": [
      {
        "name": "ProtomuxRPC"
      }
    ],
    "functions": []
  },
  "readme": {
    "content": "# Protomux RPC\n\nSimple RPC over [Protomux](https://github.com/mafintosh/protomux) channels.\n\n```sh\nnpm install protomux-rpc\n```\n\n## Usage\n\nOn the server side:\n\n```js\nconst ProtomuxRPC = require('protomux-rpc')\n\nconst rpc = new ProtomuxRPC(stream)\n\nrpc.respond('echo', (req) => req)\n```\n\nOn the client side:\n\n```js\nconst ProtomuxRPC = require('protomux-rpc')\n\nconst rpc = new ProtomuxRPC(stream)\n\nawait rpc.request('echo', Buffer.from('hello world')))\n// <Buffer 'hello world'>\n```\n\n## API\n\n#### `const rpc = new ProtomuxRPC(stream[, options])`\n\nConstruct a new RPC channel from a framed stream.\n\nOptions include:\n\n```js\n{\n  // Optional binary ID to identify this RPC channel\n  id: buffer,\n  // Optional protocol name\n  protocol: 'protomux-rpc',\n  // Optional default value encoding\n  valueEncoding: encoding,\n  // Optional handshake\n  handshake: buffer,\n  // Optional encoding for the handshake\n  handshakeEncoding: encoding\n}\n```\n\n#### `const rpc = new ProtomuxRPC(mux[, options])`\n\nConstruct a new ",
    "sections": [
      "intro",
      "usage",
      "api",
      "protocol",
      "license"
    ],
    "hasApi": true,
    "hasExamples": true,
    "exampleCount": 5,
    "examples": [
      "## Usage\n\nOn the server side:",
      "On the client side:",
      "## API\n\n#### `const rpc = new ProtomuxRPC(stream[, options])`\n\nConstruct a new RPC channel from a framed stream.\n\nOptions include:"
    ]
  },
  "patterns": [
    "stream-multiplexing",
    "binary-encoding"
  ]
}