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

goose-game

v1.0.1

Published

A lightweight npm library to simulate and play the classic Goose Game with customizable rules and boards

Readme

Goose Game Library

A simple npm package to simulate and play the classic Goose Game. Customize the board and rules as you like!

Installation

Install the package using npm:

npm install goose-game

Dependencies

This library depends on:

  • dices (install via npm install dices)
  • A custom boxes.js file for board mapping.

Usage

Importing the Library

const gooseGame = require("goose-game");

Starting the Game

Initialize the game by specifying the number of boxes, players, and a custom board mapping (optional):

const players = gooseGame.start(
  70,
  ["Mario", "Carlo", "Giovanni", "Dario"],
  mapping
);
console.log(players);
// Output: List of players with their initial positions
  • inputBoxes: Number of boxes on the board (default is 70).
  • inputPlayers: Array of player names (default is ["Mario", "Carlo", "Giovanni", "Dario"]).
  • inputMapping: Custom mapping of special boxes (default is mapping).

Running a Turn

Simulate a turn for all players:

const updatedPlayers = gooseGame.run();
console.log(updatedPlayers);
// Output: Updated player positions

Checking for a Winner

Determine if there is a winner:

const winner = gooseGame.somebodyWon();
if (winner) {
  console.log(`${winner} has won the game!`);
} else {
  console.log("No winner yet. Keep playing!");
}

Example boxes.js

Your boxes.js file should export a mapping object that defines special box effects:

exports.mapping = {
  5: +3, // Move forward 3 spaces when landing on box 5
  10: -2, // Move back 2 spaces when landing on box 10
  20: +5, // Move forward 5 spaces when landing on box 20
};

License

MIT