nodeash-socket
v4.1.23
Published
nodeash-sql is node js sql server package
Downloads
20
Readme
nodeash-socket Server
nodeash-socket is a lightweight web socket Connection package for running nodeash servers efficiently.
Installation
You can install nodeash-socket via npm:
npm install nodeash-socket
Usage
import { socketClient } from 'nodeash-socket';
const eventArray = [
{ type: 'emit', eventName: 'welcome', function: () => ({ message: 'Hello from server!' }) },
{ type: 'broadcast', eventName: 'update', data: { someData: 123 } },
{ type: 'join', room: 'myRoom' },
{ type: 'leave', room: 'anotherRoom' },
{ type: 'to', room: 'specialRoom', eventName: 'secret', function: () => ({ hushHush: 'classified' })},
];
socketClient({appServer , events : eventArray})
Contributing Contributions are welcome! If you find any issues or would like to contribute to nodeash-socket, please feel free to open an issue or submit a pull request on the GitHub repository.
License This project is licensed under the MIT License - see the LICENSE file for details.