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

boardcast-contrib

v1.1.0

Published

Community contributed game implementations for Boardcast hex board tutorials

Readme

Boardcast Contrib Library

Game-specific extensions and utilities for the Boardcast hex board animation library.

Overview

The contrib library provides specialized methods for visualizing and animating game mechanics specific to different tabletop game systems. Each game system is organized into its own module with methods that extend the core Boardcast functionality.

Available Game Systems

Lancer

RPG mech combat system with movement, engagement, and terrain mechanics.

  • Movement: Speed-based movement ranges, boost actions, terrain effects
  • Combat: Engagement zones, weapon ranges, line of sight, blast templates

Usage

import { BoardcastHexBoard } from 'boardcast';
import { Lancer } from 'boardcast/contrib';

const board = new BoardcastHexBoard();
const movement = new Lancer.LancerMovement(board);
const combat = new Lancer.LancerCombat(board);

// Show movement range for a speed 4 mech at (0,0)
movement.showMovementRange(0, 0, 4);

// Show engagement zone around mech
combat.showEngagementZone(0, 0);

Contributing a New Game System

To contribute a new game system (e.g., "MyGame"):

1. Create Module Structure

contrib/
└── mygame/
    ├── index.ts       # Main exports
    ├── types.ts       # Game-specific types
    ├── movement.ts    # Movement mechanics (if applicable)
    ├── combat.ts      # Combat mechanics (if applicable)
    └── [feature].ts   # Other game features

2. Define Game-Specific Types

// contrib/mygame/types.ts
export interface MyGameUnit {
  id: string;
  name: string;
  // Game-specific properties
}

3. Create Feature Classes

// contrib/mygame/movement.ts
import { BoardcastHexBoard } from '../../lib/BoardcastHexBoard.js';

export class MyGameMovement {
  constructor(private board: BoardcastHexBoard) {}

  showMovementPattern(q: number, r: number): void {
    // Use board.highlight(), board.pulse(), etc.
  }
}

4. Export from Module Index

// contrib/mygame/index.ts
export { MyGameMovement } from './movement.js';
export type { MyGameUnit } from './types.js';

5. Add to Main Contrib Index

// contrib/index.ts
export * as MyGame from './mygame/index.js';

Guidelines

Method Design

  • Descriptive Names: Use clear, game-specific method names
  • Flexible Parameters: Support customization (colors, ranges, etc.)
  • Return Values: Return useful data when appropriate
  • Documentation: Include JSDoc comments with examples

Visual Consistency

  • Use Colors constants from core library when possible
  • Follow existing animation patterns (pulse for ranges, blink for threats)
  • Provide sensible color defaults but allow customization

Example Method Template

/**
 * Show special game mechanic visualization
 * @param centerQ - Center hex q coordinate
 * @param centerR - Center hex r coordinate
 * @param options - Customization options
 */
showSpecialMechanic(
  centerQ: number, 
  centerR: number, 
  options: { color?: string; size?: number } = {}
): GameMechanicResult {
  const { color = Colors.BLUE, size = 1 } = options;
  
  // Implementation using board methods
  this.board.highlight(centerQ, centerR, color);
  
  return { /* useful data */ };
}

File Organization

  • One class per file for complex features
  • Related utilities can share files
  • Export everything from module index
  • Import paths should use .js extension for ES modules

Building and Testing

# Build contrib library
npm run build:contrib

# Build everything (lib + contrib + demo)
npm run build

# Type checking
npm run typecheck

# Run tests
npm run test

Module Import Structure

Core library methods are available on the board instance:

board.highlight(q, r, color);     // Core method
board.pulse(q, r, color);         // Core method
board.token(q, r, name, ...);     // Core method

Contrib methods are organized by game system:

const movement = new Lancer.LancerMovement(board);
movement.showMovementRange(q, r, speed);  // Contrib method

This separation keeps the core library lightweight while allowing rich game-specific functionality in contrib modules.