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

yamr

v0.0.1

Published

Yamr is a chat application built with [nodejs](http://nodejs.org) You can demo it by going to [yamr.net](http://yamr.net)

Downloads

2

Readme

Yamr

Yamr is a chat application built with nodejs You can demo it by going to yamr.net

Installation

Yamr was built on node v0.6.6, and requires npm, a mysql database, sass, coffeescript and yuicompressor-2.4.7. The rest of the dependencies can be installed after cloning the repository and running

npm install -d

Once set up, you'll want to edit src/config.coffee and run the following commands (or set up a build script)

coffee -o ./compiled/ -c src
sass --update src/public/stylesheets:compiled/public/stylesheets
cat compiled/public/javascripts/jquery-1.6.4.min.js > compiled/public/javascripts/all.js
java -jar yuicompressor-2.4.7.jar compiled/public/javascripts/socket.io.js >> compiled/public/javascripts/all.js
cat compiled/public/javascripts/jquery-ui-1.8.16.custom.min.js >> compiled/public/javascripts/all.js
java -jar yuicompressor-2.4.7.jar compiled/public/javascripts/chat.js >> compiled/public/javascripts/all.js
java -jar yuicompressor-2.4.7.jar compiled/public/javascripts/yamr.js >> compiled/public/javascripts/all.js
java -jar yuicompressor-2.4.7.jar compiled/public/stylesheets/chat.css -o compiled/public/stylesheets/chat.css

Once everything compiles successfully, run the following to start in development mode

NODE_ENV=development node compiled/app

Or for production mode, just run

node compiled/app

Nginx

Here is a sample nginx configuration

upstream app {
  server 127.0.0.1:8000;
}

server {
  listen 80;
  server_name yamr.net;
  root /path/to/compiled/public;

  location / {
    index index.html;

    if (-f $request_filename) {
      break;
    }

    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_pass http://app/;
    proxy_redirect off;
  }

  location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|txt)$ {
    expires max;
    access_log off;
  }
}

SQL

Here is the SQL for creating the mysql database

CREATE DATABASE `yamr` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE TABLE IF NOT EXISTS guests (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `agent` varchar(255) DEFAULT NULL,
  `ip` char(15) DEFAULT NULL,
  `created` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `messages` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `room_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `guest_id` int(10) unsigned NOT NULL,
  `message` varchar(255) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `room_id` (`room_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `rooms` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `password` varchar(128) NOT NULL,
  `created` datetime NOT NULL,
  `ip` char(15) NOT NULL,
  `agent` varchar(255) NOT NULL,
  `headshot` int(10) unsigned NOT NULL DEFAULT '0',
  `last_login` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`name`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;