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

zapi-matchmaking

v1.1.0

Published

A simple matchmaking module for Javascript.

Downloads

29

Readme

zapi-matchmaking

A super simple and light matchmaker module that matches by rank. This module is from Zarran API.

How to use

  • Call the "startMatchMaker" function with these 2 values: Whether rank is enabled for matchmaking, and if so the rank quota to be matched together.
  • Use the "startMatch" call with your user IDs afterwards.

Here's an example on how to use this:

import mm from "matchmaking"

const serverArray = [sv1, sv2, sv3]

mm.startMatchMaker(serverArray, 1, 50) // Rank matching enabled, anyone within 50 rank of another user will be matched with them
const user1 = await mm.startMatch(UUID1, "100") // Doesn't return anything until someone else enters the queue with a close enough rank or after ~21 seconds, after which it returns "002-0001". It sends a promise if the call worked.
const user2 = await mm.startMatch(UUID2, "120") // Returns sv1 for this call and the other since they both have a close enough rank to be matched.

Alternatively, if you don't want to use ranking, do this instead:

import mm from "matchmaking"

const serverArray = [sv1, sv2, sv3]

mm.startMatchMaker(serverArray, 0) // Rank matching disabled
const user1 = await mm.startMatch(UUID1) // Same as before, just without the rank check
const user2 = await mm.startMatch(UUID2) // Returns sv1 for this call and the other one since there is someone in the queue

Errors

"002-0001"

Nobody found in the queue.

"002-0002"

You have not started the match maker yet! Go do that.

"002-0003"

i forgor how to use the function right :skull: In all seriousness, please put in the right values for the function or you get this.

"002-0004"

Someone tried to run the placeholder test in package.json >:/