hestia.io

0.1.4 • Public • Published

hestia.io

npm version

Features

Hestia.io is a web app framework that manages instances of multi-user real-time apps.

It consists of

Installation

npm install --save hestia.io

Usage

Hestia manages sockets with Socket.IO, and has a similar interface for handling events. The main difference is that the socket which triggered the event is sent as the first argument to the handler function.

const express = require('express');
const app = express();
const http = require('http').createServer(app);
 
// Initialize hestia
const h = require('hestia.io')(http);
 
// Provide client-side app
app.use(express.static(__dirname + '/app/client.js'));
 
h.on('join', function(socket, data) {
  var roomID = h.createRoom();
  h.addPlayer({});
 
  // Start server-side app
  h.joinApp(roomID, 'myApp', __dirname + '/app/server.js');
  socket.emit('joined');
});
 
http.listen(5000);

Documentation

Check out the docs here!

Testing

npm test

The test suite uses Jest, and runs tests located in test directory.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i hestia.io

Weekly Downloads

9

Version

0.1.4

License

MIT

Unpacked Size

24.4 kB

Total Files

11

Last publish

Collaborators

  • michaelkim