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 🙏

© 2025 – Pkg Stats / Ryan Hefner

skyhelper-networth

v2.2.0

Published

SkyHelper's Networth Calculation for Hypixel SkyBlock

Downloads

2,016

Readme

SkyHelper-Networth

discord license npm downloads

SkyHelper's Networth Calculation as a Node.js module to calculate a player's SkyBlock networth by using their profile data provided by the Hypixel API.

Installation

npm install skyhelper-networth

Core Concepts

📦 Key Classes

  • ProfileNetworthCalculator: Handles networth calculation for player's profile.
  • GenericItemNetworthCalculator: Calculates networth for individual items.
  • NetworthManager: Central class for managing networth calculations (singleton).
  • UpdateManager: Manages periodic updates for items, prices and the networth package itself (singleton).

📄 Core Interfaces

  • NetworthOptions: Configuration for networth calculations
  • NetworthResult: Result structure for networth calculations
  • Item: Detailed representation of an in-game item

Quick Start

import { ProfileNetworthCalculator } from 'skyhelper-networth';

// Prepare input data
const profile = // https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1profile/get - profile.members[uuid]
const museumData = // https://api.hypixel.net/v2/skyblock/museum - museum.members[uuid]
const bankBalance = profile.banking.balance;
const profileData = profile.members[uid];

// Initialize the NetworthManager
const networthManager = new ProfileNetworthCalculator(profileData, museumData, bankBalance);

// Calculate profile networth
const networth = await networthManager.getNetworth();

console.log(networth);

The data structure of the output from getNetworth can be found at Type Definitions section.


Class Documentation

📊 ProfileNetworthCalculator

Handles player profile calculations

Creation

new ProfileNetworthCalculator(profileData: object, museumData?: object, bankBalance?: number)
fromPreParsed(profileData: object, items: Items, bankBalance: number): ProfileNetworthCalculator;

Calculation Methods

getNetworth(options?: NetworthOptions): Promise<NetworthResult>
getNonCosmeticNetworth(options?: NetworthOptions): Promise<NetworthResult>

Example Usage

const networthManager = new ProfileNetworthCalculator(profileData, museumData, bankBalance);
const networth = await networthManager.getNonCosmeticNetworth({ prices: customPrices });
console.log(networth.types.inventory.total); // Total value of player's inventory

const nonCosmeticNetworth = await networthManager.getNonCosmeticNetworth();
console.log(nonCosmeticNetworth.networth); // Total value of player's non-cosmetic items

🔍 ItemNetworthCalculator

Item-specific calculation

Constructor

new ItemNetworthCalculator(item: object)

Methods

getNetworth(options?: NetworthOptions): Promise<Item>
getNonCosmeticNetworth(options?: NetworthOptions): Promise<Item>

Example

const itemCalculator = new ItemNetworthCalculator(item);
const itemValue = await itemCalculator.getNetworth({ prices: newPrices });
console.log(itemValue.price); // Item's calculated value

🧰 NetworthManager

Manages global configuration and item caching

Constructor

new NetworthManager(options?: NetworthManagerOptions)

Configuration Options

Each option can be set and obtained using the corresponding set and get methods.

| Method | Property | Type | Default | Description | | ---------------------- | ----------------- | --------- | ---------------- | ---------------------------------------------------------------------------------- | | setCachePrices() | cachePrices | boolean | true | Whether to cache the prices for time after fetching them or fetch them every time. | | setPricesRetries() | cachePricesTime | number | 300000 (5m) | The amount of time to cache the prices in milliseconds. | | setCachePricesTime() | pricesRetries | number | 3 | The amount of retries to fetch the prices when failing to fetch them. | | setItemsRetries() | itemsRetries | number | 3 | The amount of retries to fetch the items when failing to fetch them. | | setItemsInterval() | itemsInterval | number | 43200000 (12h) | The interval to fetch the items from the Hypixel API in milliseconds. | | setOnlyNetworth() | onlyNetworth | boolean | false | Whether to only return the total networth or the items as well. | | setSortItems() | sortItems | boolean | true | Whether to sort items by price. | | setStackItems() | stackItems | boolean | true | Whether to stack items with the same name and price. | | setIncludeItemData() | includeItemData | boolean | false | Whether to include the item data as a property in the item object. |


Additional Features

Price Management

import { getPrices } from 'skyhelper-networth';

// Get latest prices with caching
const prices = await getPrices(true);

// Manual cache refresh
networthManager.setCachePrices(false);

Update Management

const updateManager = new UpdateManager();
updateManager.setInterval(300000); // Check updates every 5m
updateManager.disable(); // Stop automatic checks

Type Definitions

📜 NetworthOptions

| Property | Type | Default | Description | | ----------------- | --------- | -------- | ---------------------------------------------------------------------------------- | | prices | object | Prices | A prices object that includes item prices. | | cachePrices | boolean | true | Whether to cache the prices for time after fetching them or fetch them every time. | | pricesRetries | number | 3 | The amount of retries to fetch the prices when failing to fetch them. | | onlyNetworth | boolean | false | Whether to only return the total networth or the items as well. | | includeItemData | boolean | false | Whether to include the item data as a property in the item object. | | sortItems | boolean | true | Whether to sort items by price. | | stackItems | boolean | true | Whether to stack items with the same name and price. |

📜 NetworthResult

interface NetworthResult {
  networth: number;
  unsoulboundNetworth: number;
  noInventory: boolean;
  isNonCosmetic: boolean;
  personalBank: number;
  purse: number;
  bank: number;
  types: Record<InventoryType, Inventory>;
}

type InventoryType = 'armor' | 'equipment' | 'wardrobe' | ...;

type Inventory = {
    total: number;
    unsoulboundTotal: number;
    items: Array<Item>;
};

📦 Item Structure

interface Item {
    name: string;
    price: number;
    soulbound: boolean;
    cosmetic: boolean;
    calculation: Calculation[];
    // ... additional properties
}

Contribution

Contributions welcome! Please follow the project's code style and add tests for new features.

git clone https://github.com/Altpapier/SkyHelper-Networth.git
npm install
npm test