nowfound

Life & fun · June 16, 2025

Socket-call – Call socket.io events like normal JavaScript functions

Hello HN, I built a Typescript library (named socket-call, for lack of a more sexy name) whose goal is to be able to call socket.io events as regular functions. So you declare your server-side like so: ... const listenEvents = (services: UserServices) => ({ // Add your events here, the name of the event is the name of the function login: async (username: string) => { services._socket.data.user = { username }; console.log(`User ${username} logged in`); setInterval(() => { // Calling an event that's handled client-side services.showServerMessage(`You're still logged in…

Socket-call – Call socket.io events like normal JavaScript functions launched on June 16, 2025 with 44 votes, #571 of 7,999 launches that month and more than 90% of that year's launches. The site was still online in September 2026, 1 year on.

Visit github.com ↗Alternativestop 7% of June 2025

In plain words

Socket-call is a TypeScript library that lets developers call Socket.io events as regular JavaScript functions instead of using traditional event emitters. It works by allowing developers to define server-side event handlers as functions and call them from the client using standard async function syntax, eliminating the need for separate event listener and emit patterns. The library is designed for developers building real-time applications with Socket.io who want cleaner, more familiar function-call syntax.

written from the facts on this page · September 2026

From the sources

Contribute to bperel/socket-call development by creating an account on GitHub.

This small library on top of socket.io allows to call events like any regular async Typescript function. import { Server } from "socket.io" ; import { type NamespaceProxyTarget , type ServerSentStartEndEvents , useSocketEvents , } from "socket-call-server" ; const io = new Server ( ) ; user ( io ) ; io . listen ( 3000 ) ; type SessionData = { user ?: { username : string ; } ; } ; type UserServerSentEvents = { showServerMessage : ( message : string ) => void ; } ; const listenEvents = ( services : UserServices ) => ( { // Add your events here, the name of the event is the name of the function login : async ( username : string ) => { services . _socket . data . user = { username } ; console .…from github.com

In the maker’s words, at launch

Hello HN, I built a Typescript library (named socket-call, for lack of a more sexy name) whose goal is to be able to call socket.io events as regular functions. So you declare your server-side like so: ... const listenEvents = (services: UserServices) => ({ // Add your events here, the name of the event is…

Does a similar job

all alternatives →

More life & fun this month

the category →

Source: Show HN post ↗ · launch text quoted in part

Launched alongside, June 2025

the whole month →
  • IM

    Hey HN! Pilots everywhere are required to keep a logbook of all their flying hours, aircraft, airports, and so on. Since I track everything digitally (some people still just use paper logbooks!), I put together some data visualizations and a few 3D globes to show my flying history. This globe is probably my favourite so far: https://jameshard.ing/pilot/globes/all If you’ve got ideas for other graphs or ways to show this kind of data, I’d love to hear them!

    Life & fun · 2025 · jameshard.ing

  • Stunning presentations with AI. No design skills required.

    AI · 2025 · chroniclehq.com

  • Build native mobile apps for iOS and Android without code.

    Dev tools · 2025 · bble.io

  • Twenty▲989

    Build your Enterprise CRM with an AI-friendly SDK

    Dev tools · 2025 · twenty.com

  • All your connections, across all your socials.

    AI · 2025 · pally.com

  • I was the main contributor to workout.lol, an open-source fitness app to easily build a workout routine. The project had traction (1.4k GitHub stars, 95 forks, ~20K visits/month), but was eventually sold due to video licensing hurdles. The new owner stopped maintaining it, and the repo went abandoned. Over the next 9 months, I sent 15 emails to try to save it : no replies. Feature requests & issues were ignored. The community was left with a "broken" tool let's say. I couldn't just let it die So I built the new version from scratch with the same open-source spirit, but a better…

    Dev tools · 2025 · github.com