Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patrickhollweck/srocket
A socket.io framework focusing on type-safety
https://github.com/patrickhollweck/srocket
framework nodejs socket-io typescript typescript-library web websocket
Last synced: 18 days ago
JSON representation
A socket.io framework focusing on type-safety
- Host: GitHub
- URL: https://github.com/patrickhollweck/srocket
- Owner: PatrickHollweck
- License: mit
- Created: 2018-02-13T13:31:51.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T01:42:59.000Z (almost 2 years ago)
- Last Synced: 2024-04-25T18:41:41.515Z (7 months ago)
- Topics: framework, nodejs, socket-io, typescript, typescript-library, web, websocket
- Language: TypeScript
- Homepage: https://patrickhollweck.github.io/SRocket/#/
- Size: 2.42 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SRocket
A [Socket.IO](https://socket.io/docs) Framework focusing on being **type-safe**.
[![TRAVISCI Status](https://travis-ci.org/PatrickHollweck/SRocket.svg?branch=master)](https://travis-ci.org/PatrickHollweck/SRocket)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FPatrickHollweck%2FSRocket.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FPatrickHollweck%2FSRocket?ref=badge_shield)
[![Known Vulnerabilities](https://snyk.io/test/github/PatrickHollweck/SRocket/badge.svg)](https://snyk.io/test/github/PatrickHollweck/SRocket)
[![CodeFactor](https://www.codefactor.io/repository/github/patrickhollweck/srocket/badge)](https://www.codefactor.io/repository/github/patrickhollweck/srocket)
[📚 Docs](https://patrickhollweck.github.io/SRocket/#/)
[💨 Quickstart](https://patrickhollweck.github.io/SRocket/#/quickstart)
[📝 Source Code](https://github.com/PatrickHollweck/srocket)
Built with ❤︎ by Patrick Hollweck
## Sneak Peak
### Server
```ts
import { SRocket, SocketController, Controller, SocketRoute SEvent, V } from "srocket";@SocketController()
class UserController extends Controller
{
greet(event: SEvent) {
const data = event.request.validate(
V.type({
name: V.string,
}
);event.response
.withData({
greeting: `Hey, ${data.name}`,
})
.acknowledge();
}
}SRocket.fromPort(5555)
.controllers(UserController)
.listen(() => console.log("SRocket listening at http://localhost:5555"));
```### Client
```ts
const socket = io.connect("http://localhost:5555");socket.emit("greet", { name: "Patrick" }, console.log);
>> "Hello, Patrick"
```Interested? Visit the [docs](https://patrickhollweck.github.io/SRocket/#/)