OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-kb / skills / hyperswarm-dht-relay / api-extract.json

56 lines · json ref:
{
  "repo": "hyperswarm-dht-relay",
  "timestamp": "2026-01-16T23:39:39.293Z",
  "entryPoint": "./index.js",
  "exports": {
    "packageJson": {
      "main": "./index.js",
      "exports": {
        ".": "./index.js",
        "./tcp": "./tcp.js",
        "./ws": "./ws.js"
      }
    }
  },
  "api": {
    "file": "./index.js",
    "exports": [
      {
        "type": "default",
        "name": "Node"
      }
    ],
    "classes": [],
    "functions": [
      {
        "name": "relay"
      }
    ]
  },
  "readme": {
    "content": "# Hyperswarm Relay\n\n> :test_tube: This project is still experimental. **Do not use it in production**.\n\nRelaying the Hyperswarm DHT over framed streams to bring decentralized networking to everyone.\n\n## Installation\n\n```sh\nnpm install @hyperswarm/dht-relay\n```\n\n## Usage\n\nOn the relaying side:\n\n```js\nimport DHT from 'hyperdht'\nimport { relay } from '@hyperswarm/dht-relay'\n\nrelay(new DHT(), stream)\n```\n\nOn the relayed side:\n\n```js\nimport DHT from '@hyperswarm/dht-relay'\n\nconst dht = new DHT(stream)\n```\n\nFrom here, the API matches that of the Hyperswarm DHT: <https://github.com/holepunchto/hyperdht#api>\n\n### Transports\n\nAs a convenience, we provide stream wrappers for common transport protocols. These may or may not be appropriate for your particular use case and so your mileage may vary.\n\n<details>\n<summary>TCP</summary>\n\nThe TCP wrapper is a re-export of <https://github.com/holepunchto/hyperswarm-secret-stream> which adds both framing and encryption.\n\nOn the relaying side:\n\n```js\nimport",
    "sections": [
      "intro",
      "installation",
      "usage",
      "protocol",
      "license"
    ],
    "hasApi": true,
    "hasExamples": true,
    "exampleCount": 8,
    "examples": [
      "## Usage\n\nOn the relaying side:",
      "On the relayed side:",
      "From here, the API matches that of the Hyperswarm DHT: <https://github.com/holepunchto/hyperdht#api>\n\n### Transports\n\nAs a convenience, we provide stream wrappers for common transport protocols. These may or may not be appropriate for your particular use case and so your mileage may vary.\n\n<details>\n<summary>TCP</summary>\n\nThe TCP wrapper is a re-export of <https://github.com/holepunchto/hyperswarm-secret-stream> which adds both framing and encryption.\n\nOn the relaying side:"
    ]
  },
  "patterns": [
    "peer-discovery",
    "dht-discovery",
    "stream-multiplexing",
    "binary-encoding",
    "cryptography",
    "streaming"
  ]
}