@nhtio/p2pbus
A TypeScript library for creating a peer-to-peer event bus
Classes
| Class | Description |
|---|---|
| Logger | An event emitter for which emits Pino-compatible logging events. |
| P2PBus | P2PBus class is an event emitter which utilizes the libp2p library to publish and subscribe to events over a peer-to-peer network. It is designed to be used in a decentralized environment where there is no central server to handle events. |
Interfaces
| Interface | Description |
|---|---|
| EventCallbacks | The augmentable interface which describes the possible events and the shape of the event callbacks. |
| LoggerEventCallbacks | A map of event names to their corresponding callback functions for the Logger class. |
| LogMethodWithAnyTypedMergingObject | An interface represending one of the possible signatures of a logging method in the LogMethod union |
| LogMethodWithMergingObject | An interface represending one of the possible signatures of a logging method in the LogMethod union |
| LogMethodWithoutMergingObject | An interface represending one of the possible signatures of a logging method in the LogMethod union |
| LogMethodWithUnknownMergingObject | An interface represending one of the possible signatures of a logging method in the LogMethod union |
Type Aliases
| Type Alias | Description |
|---|---|
| EventEmitterEventMap | The map of events defined in EventCallbacks which emitted by P2PBus. |
| LoggerEventEmitterEventMap | A utility type to extract the event names and their corresponding arguments from the LoggerEventCallbacks interface for use with the Logger class. |
| LogMethod | Represents a pino-compatible logging method used by the events in the LoggerEventCallbacks, which can have different signatures such as: - LogMethodWithMergingObject - LogMethodWithUnknownMergingObject - LogMethodWithoutMergingObject - LogMethodWithAnyTypedMergingObject |
Variables
| Variable | Description |
|---|---|
| version | The current version of the package. |
References
EventCallbackResult
Re-exports EventCallbackResult
EventName
Re-exports EventName