@reticulum/node
v0.6.1
Published
Node.js-only Reticulum interfaces (TCP, AutoInterface, LocalClient, HTTP exchange server) and the interface registry, for reticulum-js
Downloads
2,302
Readme
@reticulum/node
Node.js-only Reticulum interfaces and the interface registry, as a companion to the zero-dependency, browser-safe @reticulum/core core.
Why this package exists
The @reticulum/core core must stay browser-safe (no node: specifiers, no external runtime dependencies). Several interfaces — TCP, the zero-config IPv6-multicast AutoInterface, the local shared-instance client, and the HTTP POST exchange server — are built on Node.js built-in modules (node:net, node:dgram, node:http, node:crypto, node:fs, node:os, node:path). They live here, in this companion, so importing @reticulum/core in a browser never pulls in Node builtins.
Installation
npm install @reticulum/nodeThis depends on @reticulum/core automatically.
Usage
Import the interface you need from the package entry:
import { Reticulum } from "@reticulum/core";
import {
AutoInterface,
LocalClientInterface,
TCPClientInterface,
} from "@reticulum/node";
const rns = new Reticulum();
// Attach to a running shared `rnsd` if one is available, else dial TCP directly.
const shared = await LocalClientInterface.connectToSharedInstance();
if (shared) {
rns.addInterface(shared, true);
} else {
const tcp = new TCPClientInterface({ host: "127.0.0.1", port: 42424 });
await tcp.connect();
rns.addInterface(tcp, true);
}What's included
| Export | Interface id | Node builtins | Notes |
| --- | --- | --- | --- |
| TCPClientInterface / TCPServerInterface | tcp-client / tcp-server | node:net, node:stream | Optional HDLC or KISS framing |
| AutoInterface | auto | node:dgram | Zero-config IPv6-multicast LAN/Wi-Fi peering |
| LocalClientInterface | local-client | node:net, node:fs, node:os, node:path | Shared-instance client + ~/.reticulum/config discovery |
| HttpPostServerInterface | http-server | node:crypto, node:http | In-memory Reticulum-post exchange server |
Interface registry
The registry aggregates every built-in interface — including the browser-safe
ones from @reticulum/core — so a Node process can enumerate interfaces and look
up their configuration schemas by id:
import {
getInterface,
getSchema,
listInterfaces,
registerInterface,
} from "@reticulum/node";
for (const meta of listInterfaces()) {
console.log(meta.id, meta.title);
}License
Licensed under the EUPL 1.2. See the monorepo README for project-wide information.
