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

@sugarch/bc-mod-utility

v0.2.11

Published

Various utility for BC mods.

Downloads

56

Readme

@sugarch/bc-mod-utility

A collection of utilities designed to simplify and enhance the development of mods for Bondage Club (BC). This package provides reusable tools and helpers to streamline common tasks in modding.

Features

  • Messager: A utility for sending custom messages.
  • Globals: A class for managing global variables and ensuring that certain functions are executed only once.

Installation

Install the package using your preferred package manager:

# Using pnpm
pnpm add @sugarch/bc-mod-utility --save-dev

# Using yarn
yarn add @sugarch/bc-mod-utility --dev

# Using npm
npm install @sugarch/bc-mod-utility --save-dev

Usage

Messager

The Messager class is the main utility provided by this package. It allows you to send various types of messages in the chat room.

import { Messager } from '@sugarch/bc-mod-utility';

// Create a new Messager instance
const messager = new Messager();

// Send a custom action message
messager.action('This is a custom action message.');

// Send a chat message
messager.chat('Hello, everyone!');

// Send a local action message (only visible locally)
messager.localAction('This is a local action message.');

// Send a whisper to a specific player
messager.whisper(12345, 'This is a private message.');

// Send a beep notification to a specific player
messager.beep(12345, 'You have a new notification!');

Globals and once

The Globals class provides a way to manage global variables and ensure that certain functions are only executed once.

import { Globals, once } from '@sugarch/bc-mod-utility';

// Create a new Globals instance, or retrieve an existing one
// the first parameter is the name of the global variable, should be unique.
const globals = Globals.get("MyGlobalName", () => {
    // This function will only be executed once if the global variable 
    // is not already set
    return new MyGlobalObject();
});

// Like the `get` method, but allows for modifying the existing global 
// variable
const globals2 = Globals.getMayOverride("MyGlobalName2", (old) => {
    // if the global variable does not exist, the parameter `old` will 
    // be `undefined`.
    // Here we can create a new instance of `MyGlobalObject2`
    if(!old) return new MyGlobalObject2();

    // Here, the `old` parameter is the existing global variable
    // We can modify it as needed
    old.registerSomeData();
    return old;
});

// The `once` method allows you to register a function that will only 
// be executed once, even if called multiple times or imported 
// multiple times.
// The first parameter is a unique flag name, and the second parameter
// is the function to be executed.
once("MyOnceFlagName", () => {
    // This function will only be executed once, even if called multiple
    // times, or the script imports multiple times
    // It is useful for initializing global variables or performing setup
    // tasks
    console.log('This will only run once!');
});