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

votifier

v0.0.0

Published

Bukkit's Votifier for Node.js

Downloads

15

Readme

node-votifier

Emulates a Bukkit Votifier server in Node.js

We at CubixCraft don't like Java that much. It kinda sucks a speed. So we always try to replace it with Node.js, whenever it's possible. So is this case. Using node-votifier reduces load on your precious Bukkit and transfers it to your wonderful Node.js app. Plus it's super easy to add vote listeners. No lame .class files anymore!


Requirements

I recommend using an Ubuntu server. However it should work on Windows / OS X / whatsoever, if your computer supports the requirements listed above.

The RSA keys aren't automatically generated by node-votifier. But it's easy to create them yourself:

  1. openssl genrsa -out private.pem 2048 generates a 2048 bit private key and stores it as private.pem
  2. openssl rsa -in private.pem -pubout > public.pem extracts the public key and stores it as public.pem

Use the public key for all the server lists. Keep the private key private. Otherwise anybody is able to cheat on your vote system.

Installation

npm install node-votifier

You could also clone this repository. If you wanna do this, you know how.

How to use

Assuming your private.pem is in the same directory as your app, a working Votifier would look like this. An extended example with error handling can be found in the examples directory.

var votifier = require("node-votifier")(__dirname + "/private.pem");

votifier.on("vote", function(user, server, ip, date) {
  console.log(user + " voted.")
});

Complete API

  • require("node-votifier") returns a Votifier Class.
  • new Votifier(pathToPrivateKey, port) or Votifier(pathToPrivateKey, port) both return a Votifier instance. They require the absolute path to the private key file. The port is optional and defaults to 8192. Votifier inherits of EventEmitter.
    • vote event. This event passes user (username of the voter), server (name of the server list), ip (IP of the voter) and date (date of the vote as a Date) to its listeners. It is fired, when Votifier receives a vote.
    • error event. This event passes error (Error with some infomation), to its listeners. This event is fired when something went wrong.

Contributing

Yes! Please! Fork and pull request! If you experience any issues you don't know how to fix or have any feture requests you're welcome to create an issue.

License

This software is licensed under my "Do-whatever-the-fuck-you-want-but-don't-be-a-dick" license. This means you're absolutely free to use, modify and redistribute this software. You can basically do whatever the fuck you want. But don't be a dick and mention my name if you think I'm worth it.