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 🙏

© 2026 – Pkg Stats / Ryan Hefner

probity

v1.2.10

Published

Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.

Downloads

924

Readme

probity

Reliable and ultra-fast generator of compbinations for slot games.

The basics

All operations are synchrous.
For high-loaded projects it's recommended to run several probity modules simultaneously.
The module should allways be loaded, and process requests from cliens as they arrive.
You may setup simple HTTP server for that, for example.

Overview

Probity is a high-performance slot combination generator.
See how it works here.

System requirements

  • linux or windows operation system
  • intel/amd x64 processor

API

The module exports two methods:

load ( options )

Loads module.
There is optional parameter to initialize module.
See set_options action below.

action ( request )

Executes the action.
request is expected to be JSON.
Return value is JSON as well.

Actions

General rule is:
Request is always has the following structure:

{	"action": "action_name"
	... some other parameters ...
}

Reply is always looks like this:

{	"request": {
		... request json ...
	},
	"success": true
	... some other data ...
}

or

{	"error": 3
}

See possible error codes below.

set_options

{	"action": "set_options",
	"log": {
		"file": "/path/to/file.log",
		"stdout": true
	}
}

log.file is file for log storage. Specify null or skip it if log should not be stored.
log.stdout is true to print error messages to stdout.

expected reply:

{	"success": true
}

set_game_definition

{	"action": "set_options",
	"game_id": "",
	"definition": "",
	"context": ""
}

game_id is unique game id string
definition is game definition string
context is game context string saved during previous probity session.

It's important to keep and restore game context string, as the module use it to generate combinations.

expected reply:

{	"success": true
}

select_game

{	"action": "select_game",
	"game_id": "",
	"session_id": "",
	"session_data": ""
}

game_id is game id string
session_id some unique string used to distinguish player sessions
session_data player session data string

It's important to save and restore player session data between sessions.
Some games use it to keep context of the game. For example, bonus game may begin in one session, and continue in another one.

expected reply:

{	"success": true
	"combination": {
		...
	}
}

combination is the combination player got in previous session.

get_game_context

{	"action": "get_game_context",
	"game_id": ""
}

expected reply:

{	"success": true
	"context": "player_session_context_string"
}

game_id is game id string

get_combination

{	"action": "get_combination",
	"session_id": "",
	"bet_sum": 9.95
}

session_id is player session id
bet_sum is bet sum
test optional reels array to be used instead of generating them.

Test reels are used for in game developmend to generate different game situations.
It's your responsitility to take care about not using this in production mode.

{	"success": true,
	"combination": {
		"reels": [
			...
		],
		"win": [
			{ ... },
			{ ... },
			{ ... }
			  ...
		],
		"total": {
			"bet": 9.95,
			"win": 15.50,
		}
	}
}

combination is the combination generates with all the winning results (if any).
reels are the reels randomly generated.
win is array of objects, where every object is game event occured.
total.bet is actual bet sum that must be deducted from player balance.
total.win is actual win sum that must be added to player balance.

get_session_data

{	"action": "get_session_data",
	"session_id": ""
}

session_id is player session id

This requests player session data.
It's recommended to request and store it after every bet.

expected reply:

{	"success": true,
	"session_data": "session data string"
}

get_game_list

{	"action": "get_session_data"
}

This returns list of available games.

expected reply:

{	"success": true,
	"game_list": [
		"first_game_id",
		"second_game_id",
		"and so on"
	]
}

Possible use case

Possible and recommended scenario of using probity:

  1. load module

  2. send set_options to initialize it

  3. send set_game_definition several times to load games

  4. wait for player request(s)

  5. player selects the game with select_game

  6. player generates the combinations with get_combination

  7. player session is stored using get_session_data

  8. goto 4

Steps 1-3 are executed only once at the beginning.
Steps 4-8 are repeated many times for every player.

Error codes

1: unexpected (unknown) error
2: json is broken
3: incorrect action
4: wrong request, incorrect parameter
5: api key is incorrect
6: game definition is incorrect
7: game context is incorrect
8: player session id not found or incorrect
9: player session data is incorrect
10: unknown game
11: error generating combination

API key

Probity module works without API key.
In this case there is the only restriction: only 8 player sessions are allowed per hour.
Please contact the author if you have any questions.