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

kiss.io

v0.7.0-beta.1

Published

A dead-simple and powerful realtime framework that respects high standards. Based upon socket.io, but better.

Downloads

11

Readme

kiss.io v0.7.0-beta.1

Travis license

kiss.io is dedicated for creating a better interface and functionality for the great ole' socket.io, following and honoring the K.I.S.S. principle - Keep it Simple, Stupid!

Why kiss.io?

  • Sexy API – elegant, simple, sleek, modern, objected-oriented and chainable interface, which makes scalability much much easier.
  • Self-contained namespaces – in kiss.io namespaces are stand-alone modules. This approach allows for better scalability and code cleanness.
  • No code clutter – Lots of old methods and unnecessary logic were removed/rewritten to match the spirit of kiss.io. We want you to just focus on the important stuff.
  • Built-in Router – Because an external plugin for a basic feature is absurd.
  • Plugins – Namespaces and sockets are extendable via plugins, which not only offer more modulization, but also extra flexibility!

check out Why kiss.io @ wiki for further ranting.


Important Disclaimer

This project is currently on beta stages and is not meant for production!

Tests might be missing; API documentation might be lacking; and backwards compatibility is not promised. Use at your own risk.


Installing

$ npm install kiss.io

Debugging

kiss.io uses the debug package utility for monitoring it's activity.
Simply start logging activity to the screen by setting the DEBUG environment variable to kiss.io:* like this:

$ set DEBUG="kiss.io:*"

You can also set DEBUG for each module by itself, by assigning one (or more) of the following values:

kiss.io:server | kiss.io:client | kiss.io:namespace | kiss.io:plugin | kiss.io:router | kiss.io:socket

$ set DEBUG="kiss.io:server,kiss.io:namespace"

Getting Started

Server Side

socket.io style
creates a new kiss.io server (var io), prints a message when a socket is connected, and listens on port 3000.

var kiss = require('kiss.io');
var io   = new kiss();
var main = io.of('/');

// socket.io style
main.on('connection', function(socket)
{
    console.log('Welcome %s', socket.id);
    
    socket.once('disconnect', function()
    {
        console.log('Bye bye %s', socket.id);
    });
});

io.listen(3000);

kiss.io style
a bit more 'modern', express.js style of writing. registers events for sockets using the event (aka on) method. mounts the main namespace on the server, and start listening on port 3000.

var kiss = require('kiss.io'),
    io   = new kiss();
var main = kiss.Namespace('/');

main.event('connection', function(socket)
{
    console.log('Welcome %s', socket.id);
});

// you can do it also like this
main
  .event('disconnect')
  .once()
  .triggers(function onDisconnect(socket)
  {
      console.log('Bye Bye %s', socket.id);
  });

io
.mount(main)
.listen(3000);

kiss.io + Express.js
this shows the possibility to attach an Express.js instance as the front-end for the kiss.io server, and using multiple routes for manipulating data on the server (sending and recieving messages). also note that in this example we used a singleton instance of server instead of creating a new independent one.

var express = require('express');
var kiss = require('kiss.io'),
    io = kiss();

var app = express();
var chat = kiss.Namespace('/chat');

app.get('/', function(req, res)
{
    res.status(200).send('Welcome to kiss.io chat!');
});

chat.on('connection', function(socket)
{
    console.log('a guest has joined the chat');
});

chat.on('send-msg', function(msg)
{
    this.socket
    .broadcast('new-msg', msg, this.socket.id);
});

chat.on('new-msg', function(msg, author)
{
    console.log('%s says: %s', author, msg);
});

io
.mount(chat)
.attach(app)
.listen(3000);

Client Side

Client side for kiss.io is powered via socket.io-client which you can find via cdnjs.com or the socket.io website.

Use just as you used to. kiss.io uses the same transport mechanism as socket.io (both powered by engine.io) so the logic for client is the same for both kiss.io and socket.io. This is also holds true for socket.io-java-client, socket.io-client-swift and socket.io-client-cpp.

Further Documentation

Visit the kiss.io wiki.

Plugins Spotlight

Also check out


LICENSE

MIT