
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@rsksmart/rif-communications-pubsub
Advanced tools
Library for creating a PubSub room with libp2p
This project extends the ipfs-pubsub-room, rewriting it in typescript and adding libp2p node.
> npm install @rsksmart/rif-communications-pubsub
WARNING: This package still have not been released!
Example of usage:
import { Room, createLibP2P } from '@rsksmart/rif-communications-pubsub'
const libp2p = await createLibP2P()
const room = createRoom(libp2p, 'my_topic')
room.on('peer:joined', (peer: string) => {
console.log('Peer joined the room ', peer)
})
room.on('peer:left', (peer: string) => {
console.log('Peer left the room', peer)
})
room.on('message', ({from, data}: {from: string, data: Buffer}) => {
console.log('New message from ', peer, ' content ', data)
})
room.on('unsubscribed', () => {
console.log('Unsubscribed from the room room')
})
const libp2p = await createLibP2P()
const room = createRoom(libp2p, topic) // Creates room with specific topic
room.leave() // Leave the room, stop libp2p
async room.broadcast(message: string | buffer) // Send message to the room
room.peerId
room.peers
room.hasPeer(cid: string)
room.on('peer:joined', (cid: string) => {})
room.on('peer:left', (cid: string) => {})
room.on('message', (message: {from: string, data: Buffer, to?: string}) => {})
room.on('unsubscribed', () => {})
FAQs
PubSub module
The npm package @rsksmart/rif-communications-pubsub receives a total of 3 weekly downloads. As such, @rsksmart/rif-communications-pubsub popularity was classified as not popular.
We found that @rsksmart/rif-communications-pubsub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.