JSPM

  • Created
  • Published
  • Downloads 440
  • Score
    100M100P100Q82300F
  • License BSD-3-Clause

Real-time client/server communication over UDP using WebRTC and Node.js

Package Exports

  • @geckos.io/server
  • @geckos.io/server/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@geckos.io/server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

logo

@geckos.io/server

NPM version Downloads Node version Snyk Vulnerabilities for GitHub Repo (Specific Manifest) NPM Codecov ES Modules Badge

Real-time client/server communication over UDP using WebRTC and Node.js.

This framework fits perfectly with your next HTML5 real-time multiplayer games or chat app.

Read the documentation for more information.

Install

npm install @geckos.io/server

How to use

import geckos from '@geckos.io/server'

const io = geckos()

io.listen()

io.onConnection(channel => {
  channel.onDisconnect(() => {
    console.log(`${channel.id} got disconnected`)
  })

  channel.on('chat message', data => {
    console.log(`got ${data} from "chat message"`)
    // emit the "chat message" data to all channels in the same room
    io.room(channel.roomId).emit('chat message', data)
  })
})