{"repo":"tinyhttp/tinyws","free":true,"listed":false,"github":"https://github.com/tinyhttp/tinyws","clone":"git clone https://github.com/tinyhttp/tinyws.git","description":"🚡 tiny WebSocket middleware for Node.js","language":"TypeScript","stars":415,"topics":["websocket","ws","nodejs","javascript","server","http","express","polka","tinyhttp"],"license":"MIT","category":"networking-infra","readme_excerpt":"🚡 tiny WebSocket middleware for Node.js [![Version][v-badge-url]][npm-url] [![Downloads][dl-badge-url]][npm-url] [![GitHub Workflow Status][gh-actions-img]][github-actions] [![Codecov][cov-badge-url]][cov-url] tinyws is a WebSocket middleware for Node.js based on ws, inspired by koa-easy-ws. Check the chat example out to get familiar with tinyws. Features - Small size ( 498B ) - Easy to use (only req.ws and nothing else) - Framework-agnostic (works with tinyhttp, express etc) - Written in TypeScript - Pure ESM Why not express-ws? because express-ws is... - Abandoned since 2018 💀 - Doesn't come with types out of the box (have to install @types/express-ws ) - Not compatible with tinyhttp and polka - Buggy as hell - Doesn't have tests Install Example Restricting WebSocket to specific paths You can restrict WebSocket handling to specific paths using the paths option: See examples for express and polka integration. [v-badge-url]: https://img.shields.io/npm/v/tinyws.svg?style=for-the-badge&color=F55A5A&label=&logo=npm [npm-url]: https://www.npmjs.com/package/tinyws [cov-badge-url]: https://img.shields.io/coveralls/github/tinyhttp/tinyws?style=for-the-badge&color=F55A5A [cov-url]: https://coveralls.io/github/tinyhttp/tinyws [dl-badge-url]: https://img.shields.io/npm/dt/tinyws?style=for-the-badge&color=F55A5A [github-actions]: https://github.com/tinyhttp/tinyws/actions [gh-actions-img]: https://img.shields.io/github/actions/workflow/status/tinyhttp/tinyws/main.yml?branch=master&sty","default_branch":null,"files":null,"tree":[],"storefront":"/r/tinyhttp","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tinyhttp/tinyws/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}