npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

soba-be

v1.0.2

Published

The backend socket.io listeners to handle soba-game's HOCs

Downloads

2

Readme

Soba - Backend

npm version

Soba is a simple React-based web game engine. By using higher-order components, Soba manages the generic socket.io messages and injecting additional functions as props. Integrating with Soba allows web games to be made more lightweight.

This is a library function for the Node backend contrasting the React front-end using Soba.

For more information regarding game design and how Soba works, see the main repository.

Applications using Soba

There is a starting example in this repository to start off with.

The following are other projects that use Soba.

  1. Articulate
    • Game Link: https://articulate-game.herokuapp.com/
    • Source Code
      • Front-end: https://github.com/chriz218/articulate
      • Back-end: https://github.com/zhenghung/articulate-be

Dependency

  1. socket.io
$ npm install --save socket.io

Installation and Quickstart

  1. Install the npm module in your NodeJS backend server project root directory

    $ npm install --save zhenghung/soba-be
  2. Import the function and use it in your io.on callback. An example template index.js file is as follows:

    This requires a few dependencies which can be installed with this

    $ npm install --save http express socket.io cors

    index.js

    const http = require('http');
    const express = require('express');
    const socketio = require('socket.io');
    const cors = require('cors');
    const soba = require('soba-be');
        
    const app = express();
    const server = http.createServer(app);
    const io = socketio(server);
       
    app.use(cors());
    app.use(express.json());
       
    io.on('connect', (socket) => {
        soba(io, socket, {logging: true});
       
        /** Add more socket.on listener handlers here*/
    });
       
    server.listen(process.env.PORT || 5000,() => console.log(`Server has started.`));

Configuration

Custom configuration can be tweaked as it it passed as the third argument into the function. soba(io, socket, config)

Default configurations

{
    logging: false
}