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

cli-game-utils

v1.3.0

Published

Utils for simple, command line based games

Downloads

71

Readme

Command Line Utilities

Overview


cli-game-utils is a node module providing functions for games with a command line interface or purely command line games. While the module is intended to be used for games, it can be used for other projects involving text output as well.

Functions


1. sPrint(input, [delay, endNewLine])

sPrint will sequentially print the string inputted with a timed (default is 100 milliseconds) delay between each character. delay specifies the delay between each character. endNewLine is a boolean which will determine whether a newline is appended to the string.

2. sleep(milliseconds)

sleep will add a delay to the program for a specified amount of time in milliseconds.

Classes


Printer

The Printer class currently has 1 function and 1 constructor. Note: In the source code, there is an instance of the class called printer with defaultCharDelay set to 100.

Constructor:

The constructor takes a value, defaultCharDelay which is used when the user does not specify a delay.

Functions:
writeQuestion(query, [charDelay])

writeQuestion will output the specified query (using sPrint) and pause until the user gives an input via the command line. If charDelay is not specified the defaultCharDelay will be used.

Examples

const util = require("cli-game-utils");
util.sPrint("Hello World!", 200, true);

Output:

const util = require("cli-game-utils");
console.log("This is printed immediately.");
util.sleep(3000);
console.log("This is executed three seconds later.");

Output:

Other Files and Scripts

1. genLootTable.js

About

genLootTable.js is a small script that will help a user generate loot tables stored in a JSON file. The format of the JSON file is as follows:

{
    "Object1" : {
        "Loot1" : 75,
        "Loot2" : 25
    },
    "Object2" : {
        "Loot1" : 100
    }
}

The percentage for each loot item must add up to 100%, and the script will automatically fill in percentage values when it is at the last pair in each object. The resulting JSON file can be used to your pleasure, and functions to read this file will be added soon.

Running the Script

To run the loot table generator, type the following into your command line and follow the instructions that appear:

node genLootTable.js
Here is an example of a loot table generated by the script:
{
	"Skeleton" : {
		"Bone" : 30,
		"Sword" : 50,
		"Teeth" : 20
	},
	"Goblin" : {
		"Gold" : 45,
		"Dagger" : 20,
		"Goblin Guts" : 35
	},
	"Ogre" : {
		"Club" : 80,
		"Ogre Brains" : 20
	}

}