Skip to content

Instantly share code, notes, and snippets.

View tomasevich's full-sized avatar
❤️
TypeScript / JavaScript

Vyacheslav tomasevich

❤️
TypeScript / JavaScript
  • Russia, Krasnodar
View GitHub Profile
@reggi
reggi / socket-io-emit-async.js
Last active June 4, 2024 08:46
Socket.io emit async
var io = require('socket.io-client')("http://localhost:3001")
var Promise = require("bluebird")
io.emitAsync = Promise.promisify(io.emit)
io.emitAsync("report", {
"name": "thomas"
}).then(function(data){
console.log(data)
}).catch(function(e){
console.log(e.message)