Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pouchlabs/pouchrealtor
blazing fast socket.io alternative,pure websockets.
https://github.com/pouchlabs/pouchrealtor
io pubsub realtime socket websocket ws
Last synced: 2 days ago
JSON representation
blazing fast socket.io alternative,pure websockets.
- Host: GitHub
- URL: https://github.com/pouchlabs/pouchrealtor
- Owner: pouchlabs
- License: mit-0
- Created: 2024-04-27T14:03:23.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-05-22T17:14:09.000Z (8 months ago)
- Last Synced: 2024-05-22T17:27:43.951Z (8 months ago)
- Topics: io, pubsub, realtime, socket, websocket, ws
- Language: JavaScript
- Homepage: https://pouchrealtor.onrender.com
- Size: 123 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License.md
Awesome Lists containing this project
README
# pouchrealtor
blazing fast socket.io alternative,pure websockets.its a pure websocket for nodejs and browser,draws inspiration from socket.io.if you know socket.io you already know pouchrealtor
# features
* pure websockets
* blazing fast
* works in nodejs and browser
* easy rooms logic## install
```bash
npm install @pouchlab/realtor
```## server usage
```js
import {Realtor} from '@pouchlab/realtor';
import express from 'express';
//with express
const app = express()const realtime = new Realtor({server:app})//expects object
console.log(realtime)//room
let chatroom = new realtime.Room('/chat')
console.log(chatroom)//events
chatroom.emit('welcome',{msg:'hi from server'},(res)=>{
console.log(res)
})
chatroom.on('welcome',(socket)=>{
console.log(socket)
})app.listen(3000)
```
## client usage
```js
import {CreateClient} from '@pouchlab/realtor';let client = createClient('ws://localhost:3000/chat')//ws or wss only
//events
client.emit('welcome',{msg:'hi from server'},(res)=>{
console.log(res)
})
client.on('welcome',(res)=>{
console.log(res)
})```
# support
if you like pouchrealtor,help maintain its development,this keeps the maintainer motivated
[donate](https://ko-fi.com/pouchlabs)
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/H2H3XBF9G)