@welshman/net
v0.0.36
Published
Utilities for connecting with nostr relays.
Downloads
1,037
Readme
@welshman/net
Utilities having to do with connection management and nostr messages.
Connection
- a wrapper forSocket
with send and receive queues, and aConnectionMeta
instance.ConnectionMeta
- tracks stats for a givenConnection
.Context
- an object containing a defaultPool
and global configuration options.Executor
- implements common nostr flows on a giventarget
Pool
- a thin wrapper aroundMap
which storesConnection
s.Publish
- utilities for publishing events.Socket
- a wrapper around isomorphic-ws that handles json parsing/serialization.Subscribe
- utilities for making requests against nostr relays.Tracker
- tracks which relays a given event was seen on.
Executor target
s extend Emitter
, and have a send
method, a cleanup
method, and a connections
getter. They are intended to be passed to an Executor
for use.
targets/Multi
allows you to compose multiple targets together.targets/Plex
takes an array of urls and aConnection
and sends and receives wrapped nostr messages over that connection.targets/Relay
takes aConnection
and provides listeners for different verbs.targets/Relays
takes an array ofConnection
s and provides listeners for different verbs, merging all events into a single stream.