Ir al contenido principal
Latest blog post (July 25, 2024): npm package provenance.

· 3 minutos de lectura
Kevin Guo

Hello developers,

Since we put up an invitation to participate in a user study, we collected hundreds of responses and had the chance to speak in depth with several Socket.IO users. Thank you for your interest in the user study and helping us understand your experience.

In this post, I am going to share with you some notable learnings from the study. It’s our hope that such sharing can shed light on how we can build a stronger community as Socket.IO users, contributors, and cloud providers.

· Un minuto de lectura

Hello everyone!

I'm happy to announce that Socket.IO is now compatible with Deno, which is a runtime for JavaScript and TypeScript written in Rust.

Usage:

import{ serve }from"https://deno.land/std@0.150.0/http/server.ts";
import{ Server }from"https://deno.land/x/socket_io@0.1.1/mod.ts";

const io =newServer();

io.on("connection",(socket)=>{
console.log(`socket ${socket.id} connected`);

socket.emit("hello","world");

socket.on("disconnect",(reason)=>{
console.log(`socket ${socket.id} disconnected due to ${reason}`);
});
});

awaitserve(io.handler(),{
port:3000,
});

And then run with:

$ deno run --allow-net index.ts

The API is very similar to the one exposed by the Node.js implementation.

Next steps:

  • client implementation
  • compatibility with the Node.js ecosystem (msgpack parser, adapters, admin UI, ...)

Feedback is welcome!

AltStyle によって変換されたページ (->オリジナル) /