New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-rooms

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-rooms

Auto create rooms where mates can chat and do actions. Auto update history

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

node-rooms

A layer between your backend point (express/swagger/etc) and your app logic.

cosnt rooms = require('node-rooms');
const MyAppLogicsClass = require('./myAppLogics');
const lobby = new rooms.Lobby(MyAppLogicsClass);
app.get('/', (req, res) => {
	lobby.findRoom().then(result => {
		res.status(result.code);
		res.send(JSON.stringify(result.data));
	});
});

Lobby methods (all async):

lobby.findRoom()

returns an URI of random available room

lobby.joinRoom(roomId, nickname, ...)

returns an object with a key, fixed nickname and something else override MyAppLogicsClass.onMateJoin() to extend

lobby.getUpdates(roomId, key)

delayed reply with room history slice: joins, leaves, actions etc triggers when it needs

lobby.action(roomId, key, action, ...)

any user action - maybe message or game turn

Check errors with result.code !== LobbyCodes.Ok

MyAppLogicsClass

needs be extended from RoomActionsBase

FAQs

Package last updated on 21 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts