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 🙏

© 2025 – Pkg Stats / Ryan Hefner

rs-chat

v2.0.7

Published

Rs chat is a node.js realtime chat moduel and javascript plugin

Downloads

35

Readme

Live Demo

https://rs-chat-demo.herokuapp.com

Demo Gif Image

Demo Gif

Youtube Instalation Guide

Youtube Instalation Guide

Getting started

Get a copy of the plugin

You can install it through npm.

$ npm install rs-chat

Setup for nodejs

Open index.js file and put the below code and start nodejs server

var app = require('http')
var chat = require('rs-chat')(app);

chat.init({
  host     : 'localhost', // DB host
  user     : 'user', // DB User
  password : 'password', // DB Password
  database : 'database', // DB Name
  assets   : 'assets' // assets path
});

Create table

CREATE TABLE `messages` (
  `id` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `toId` int(11) NOT NULL,
  `msg` mediumtext COLLATE utf8mb4_bin NOT NULL,
  `type` int(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0 / null = text, 1 = image, 2=video',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `read_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

Load the required files

Inside the page's head tag include the CSS file.

<link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/dist/rs-chat.min.css">

In the page's footer, just before </body>, include the required JavaScript files.

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js"></script>

<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/rs-chat.min.js"></script>

Instantiate the chat plugin

<script type="text/javascript">
  RSChat.init({
    socketUrl: 'http://localhost:8080/' // server url,
    userId: '1', // logged in user id
    name: 'ravi shukla', // logged in user name
  });
</script>

Call the below function to open chat box

RSChat.start('user_id', 'username')

Global Settings

S.No|Options|Type|Purpuse ---|---|---|--- 1|emoji(optional)|Bool|Enable emoji feature or not 3|iconSize(optional)|Integer|Emoji size 2|media(optional)|Bool|Enable / Disable media 4|assetPath|String|Asset path for the media 6|supportedFile(optional)|Array|Supported media file 5|invalidFileMessage(optional)|String|Message on wrong media file 7|perPage(optional)|Integer|Pagination for the chat list 8|marginRight(optional)|Integer|Margin for each chat window 9|beforeDialogOpen(optional)|Promise|Callback before chat box open 10|maxFileSize(optional)|Integer|Max file size to upload default 1MB 11|maxFileSizeError(optional)|String|Error message on big media file

Support

If you found a bug please submit it in the Issues.

If you need help with implementing the chat in your project, You can mail me at [email protected]

Suggestion

If you have any suggestion, You can write mail to me at [email protected]