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

cias

v4.0.3

Published

Tools for helping run the Games in a Snap event on twitch.tv

Downloads

27

Readme

CiaS

npm install cias

//Required Dependencies

npm install mysql
npm install tmi.js

This library is meant to act as a twitch bot extension to allow for the smooth management and performance of Games in a Snap and other E-Sport events. It originally was written for the "Cities in a Snap" event, which Games in a Snap grew out of.

BEFORE YOU BEGIN

Reserved.

Implementation

Includes


const mysql = require(`mysql`);     // Requirement
const tmi = require('tmi.js');      // Recommended for chat functionality, though not strictly necessary to function.
const config = require('./config'); // Recommended to store variables safely

Building the Config

    const ciasOPTS = {
        initialize: true,                           // Required true/false to initialize DB and Table automatically using the parameters given. Recommended for first use.
        MYSQLhost: `path.to.host`,                  // Required
        MYSQLuser: `sqlUser`,                       // Required
        MYSQLpassword: `sqlPassword`,               // Required
        MYSQLdatabase: `<db_name>`,                 // Required
        EventsTable: `<events_table>`,              // Required
        CompetitorsTable: `<competitors_table>`,    // Required
        UsersTable: `<UsersRegistration_table>`,    // Required
        channel: `<YourChannel>`                    // Required
    }

USE

Announcements

Announces the input text to all participants in an event.

cias.announce(channel, msg);

Route

Announces the input text to a single participant as specified.

cias.announce(participant, msg);

Join

Same as tmi.js client.join(), but cycles through current participants.

cias.join();

Part

Same as tmi.js client.part(), but cycles through current participants.

cias.part();

Participant

Returns single Participant object based on the number given for the event in question.

cias.participant(participant, callback);

Participants

Returns All Participants as objects based on the event in question.

cias.participants(callback);

Refresh

Refreshes Participants list.

cias.refresh(callback);

Errors

Runs the CiaS Module's Error Module. (mostly for internal use)

cias.error(err);

Set Event Number

Sets the event number (integer) for the rest of the module to operate on. See the example for details on how to implement.

cias.setEvent(event, callback);

Timer

Manually runs the CiaS Module's Timer for a length of time (in minutes, float).

cias.timer(channel, length);

Ten Seconds Remaining

Calls the final 10 seconds sequence.

cias.tenseconds(channel);

Starting Timer (30 seconds)

Starts the event. Length (optional) is a value in minutes.

cias.starting(channel, length);

Notes: A length of 0 will result in the starting countdown running on its' own. A valid, non-zero integer (or decimal) will result in the starting countdown followed by the event timer starting. A length of 0 will result in the starting countdown running on its' own.

Developed by Cazgem (https://cazgem.com) for use as part of cities in a snap, and Games in a Snap (https://twitch.tv/gamesinasnap) specifically for his chatbot, Polyphony.