@10abdullahbutt/websocket-gateway
v1.0.0
Published
My app
Readme
@boolmind/websocket-gateway
A NestJS-style WebSocket gateway package for handling real-time communication using Socket.IO. Easily integrate WebSocket support into your NestJS applications.
Features
- NestJS-like module and gateway structure
- Handles connection, disconnection, and message events
- Emits and receives messages using Socket.IO
- Ready for Docker and CI/CD
- Includes Husky pre-commit hooks and Jest tests
Installation
npm install @boolmind/websocket-gatewayUsage
import { Module } from '@nestjs/common';
import { WebsocketModule } from '@boolmind/websocket-gateway';
@Module({
imports: [WebsocketModule],
})
export class AppModule {}Gateway Example
import { WebsocketGateway } from '@boolmind/websocket-gateway';
// Use as a provider or extend for custom logicScripts
npm run build— Build TypeScriptnpm run test— Run Jest testsnpm start— Start the built app
Docker
Build and run with Docker:
docker build -t boolmind-websocket-gateway .
docker run -p 3000:3000 boolmind-websocket-gatewayTesting
npm run testContributing
- Fork the repo
- Create your feature branch (
git checkout -b feature/fooBar) - Commit your changes (
git commit -am 'Add some fooBar') - Push to the branch (
git push origin feature/fooBar) - Create a new Pull Request
License
MIT
