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

economy-phoenix

v2.0.1

Published

Flexible Economy System for Node.js projects. Originally developed for the Phoenix Bot, now available for general use.

Readme

economy-phoenix

economy-phoenix ist ein flexibles und einfach integrierbares Economy-System für Node.js-Projekte. Ursprünglich für den Phoenix WhatsApp-Bot entwickelt – jetzt für alle Projekte geeignet.


🚀 Features

  • 💰 Wallet- & Bank-System
  • 📈 Bankkapazität erweiterbar (/cookieupgrade)
  • 🎁 Tägliche Belohnungen (/daily)
  • 🔁 Überweisungen zwischen Nutzern (/transfer)
  • 🏴‍☠️ Ausrauben anderer Nutzer (/rob)
  • 🎢 Erweiterbar für Spiele (Roulette, Blackjack, uvm.)
  • 📂 Speichert in JSON-Dateien – keine zusätzliche Datenbank notwendig

📦 Installation

npm install economy-phoenix

🔧 Beispielnutzung

const eco = require('economy-phoenix');

// Benutzer-Wallet anzeigen
const balance = eco.balance('user-id');
console.log(balance);

// Einzahlung vornehmen
const deposit = eco.deposit('user-id', 500);
console.log(deposit);

// Auszahlung vornehmen
const withdraw = eco.withdraw('user-id', 200);
console.log(withdraw);

// Tägliche Belohnung abholen
const daily = eco.daily('user-id');
console.log(daily);

📂 Speicherort

Standardmäßig wird die Wirtschaft in folgender Datei gespeichert:

./database/economy.json

Du kannst einen eigenen Pfad angeben:

const eco = require('economy-phoenix');
eco.getUserEconomy('user-id', './meinPfad/economy.json');

🛠️ API Referenz

getUserEconomy(userId, dbPath?)

Holt oder erstellt die Wirtschaftsdaten eines Nutzers.

| Parameter | Typ | Beschreibung | | --------- | ------ | -------------------------------------------------------------------------- | | userId | String | ID des Nutzers | | dbPath | String | (optional) Pfad zur JSON-Datenbank (Standard: ./database/economy.json) |

Rückgabe:

{
  wallet: Number,
  bank: Number,
  bankCapacity: Number,
  lastDaily: Number,
  cooldowns: Object
}

balance(userId, dbPath?)

Gibt das aktuelle Wallet- & Bankguthaben eines Nutzers zurück.

{
  wallet: Number,
  bank: Number,
  bankCapacity: Number
}

deposit(userId, amount, dbPath?)

Zahlt Geld vom Wallet auf die Bank ein.

{
  noten: Boolean,  // true = Einzahlung fehlgeschlagen
  amount: Number,  // Betrag der eingezahlt wurde
  message?: String // Bei Fehler: z.B. "Bankkapazität überschritten."
}

withdraw(userId, amount, dbPath?)

Hebt Geld von der Bank ab und fügt es dem Wallet hinzu.

{
  noten: Boolean,  // true = Auszahlung fehlgeschlagen
  amount: Number,
  message?: String
}

daily(userId, rewardAmount?, dbPath?)

Tägliche Belohnung erhalten (Standardbetrag: 999).

{
  cd: Boolean,     // true = noch im Cooldown
  cdL: String|null, // verbleibende Zeit, falls cd = true
  amount: Number    // erhaltene Belohnung (0 wenn noch Cooldown)
}

transfer(fromId, toId, amount, dbPath?)

Überweist Guthaben an einen anderen Nutzer.

{
  success: Boolean,
  amount: Number,
  message?: String
}

rob(fromId, toId, maxSteal?, dbPath?)

Versucht, einen anderen Nutzer auszurauben.

{
  success: Boolean,
  amount?: Number,
  message?: String
}

give(userId, amount, dbPath?)

Fügt einem Nutzer Guthaben hinzu. → Rückgabe: true

deduct(userId, amount, dbPath?)

Zieht Guthaben von einem Nutzer ab. → Rückgabe: true | false

giveCapacity(userId, capacity, dbPath?)

Setzt die Bankkapazität eines Nutzers. → Rückgabe: true

loadEconomy(dbPath?)

Lädt die gesamte Datenbank als Objekt.

saveEconomy(db, dbPath?)

Speichert die übergebene Datenbank.


🌍 English Version

economy-phoenix is a flexible and easy-to-use economy system for Node.js projects. Originally developed for the Phoenix WhatsApp Bot – now suitable for all your projects.

🚀 Features

  • 💰 Wallet & Bank System
  • 📈 Upgradeable Bank Capacity (/cookieupgrade)
  • 🎁 Daily Rewards (/daily)
  • 🔁 Transfers Between Users (/transfer)
  • 🏴‍☠️ Rob Other Players (/rob)
  • 🎢 Extendable for Games (Roulette, Blackjack, etc.)
  • 📂 Stores in JSON files – no additional database required

📦 Installation

npm install economy-phoenix

🔧 Example Usage

const eco = require('economy-phoenix');

const balance = eco.balance('user-id');
console.log(balance);

const deposit = eco.deposit('user-id', 500);
console.log(deposit);

const withdraw = eco.withdraw('user-id', 200);
console.log(withdraw);

const daily = eco.daily('user-id');
console.log(daily);

📘 API Reference

getUserEconomy(userId, dbPath?)

Gets or creates user economy data.

{
  wallet: Number,
  bank: Number,
  bankCapacity: Number,
  lastDaily: Number,
  cooldowns: Object
}

balance(userId, dbPath?)

Returns the user's wallet and bank balance.

deposit(userId, amount, dbPath?)

Deposits money from wallet to bank.

withdraw(userId, amount, dbPath?)

Withdraws money from bank to wallet.

daily(userId, rewardAmount?, dbPath?)

Collect daily rewards (default: 999).

transfer(fromId, toId, amount, dbPath?)

Transfers balance to another user.

rob(fromId, toId, maxSteal?, dbPath?)

Attempts to rob another player.

give(userId, amount, dbPath?)

Adds balance to a user.

deduct(userId, amount, dbPath?)

Deducts balance from a user.

giveCapacity(userId, capacity, dbPath?)

Sets a user's bank capacity.

loadEconomy(dbPath?)

Loads the entire database.

saveEconomy(db, dbPath?)

Saves the provided database.

📄 License

MIT License © 2025 Exiqon