Skip to content

API Reference

WARNING

This section documents the old Node.js API (@vibecook/truffle). The v2 architecture (RFC 012) replaced the entire networking stack with a Rust-native Node API. The NAPI-RS bindings have not yet been updated. For the current Rust API, see the Architecture guide.

Core Package (Legacy)

Install @vibecook/truffle to get all the core exports.

bash
npm install @vibecook/truffle

Exports

ExportSource PackageDescription
createMeshNodetruffle-meshCreate a new mesh node
MeshNodetruffle-meshMesh node class
DeviceManagertruffle-meshDevice state manager
MeshMessageBustruffle-meshMessage bus implementation
StoreSyncAdaptertruffle-store-syncStore synchronization adapter
createLoggertruffle-typesDefault logger factory
TypedEventEmittertruffle-typesType-safe event emitter base

Types

TypeDescription
MeshNodeConfigConfiguration for creating a mesh node
MeshNodeEventsEvent map for MeshNode
MeshTimingConfigTiming configuration
BaseDeviceDevice information
DeviceSlice<T>Store slice with data, version, timestamps
MeshEnvelopeWire format for mesh messages
ISyncableStore<T>Interface for syncable stores
IMessageBusInterface for the message bus
BusMessageMessage received from the bus
LoggerLogger interface

Additional Packages

PackageDescription
@vibecook/truffle-reactReact hooks
@vibecook/truffle-cliCLI tool

Released under the MIT License.