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

@thezelijah/price-genie

v1.0.3

Published

A simple pricing tool that helps you calculate the right rate based on your costs, expenses, and desired profit—perfect for entrepreneurs, vendors, and small businesses.

Readme

Price Genie 🧞

Price Genie is a simple yet powerful pricing calculator that helps entrepreneurs, freelancers, and small businesses determine fair, profitable rates for their products or services. Designed with cost-based pricing principles, Price Genie empowers you to make informed decisions based on your actual costs, expenses, and target profit margins.

💡 “Take control of your pricing with logic, not guesswork.”


🌐 Live Demo

Price Genie Thumbnail

Click the image to try the interactive pricing calculator.


✨ Features

  • Calculate ideal prices based on costing breakdown
  • Transparent computation logic with per-item control
  • Built for freelancers, creatives, startups, and service providers
  • Written in TypeScript — fully typed, no runtime dependencies
  • Supports fixed markup, profit targets, or manual override
  • Modular and extensible class structure
  • Lightweight — zero dependencies

Full API Docs


📦 Installation

npm install @thezelijah/price-genie

🛠 Usage

Step 1: Initialize and Setup Price Genie

Basic Setup

import { PriceGenie, type CostingItem } from '@thezelijah/price-genie';


const genie = PriceGenie.initialize();


const sampleCostingItems: CostingItem[] = [
  {
    label: "Labor",
    description: "Skilled worker wages for assembly and packaging",
    quantity: 20,
    unit: "hrs",
    unitPrice: 250,
    amount: 5000,
    costMargin: 0.25,
    multipliers: {
      quantity: 1,
      unitPrice: 1,
    },
  },
  {
    label: "Raw Materials",
    description: "High-quality wood used for furniture production",
    quantity: 10,
    unit: "pcs",
    unitPrice: 750,
    amount: 7500,
    costMargin: 0.2,
    multipliers: {
      quantity: 1,
      unitPrice: 1,
    },
  },
  {
    label: "Logistics",
    description: "Delivery and transportation of finished goods",
    quantity: 2,
    unit: "trips",
    unitPrice: 1200,
    amount: 2400,
    costMargin: 0.15,
    multipliers: {
      quantity: 1,
      unitPrice: 1,
    },
  },
  {
    label: "Packaging",
    description: "Custom printed boxes and wrapping materials",
    quantity: 100,
    unit: "sets",
    unitPrice: 35,
    amount: 3500,
    costMargin: 0.1,
    multipliers: {
      quantity: 1,
      unitPrice: 1,
    },
  },
];


// Set Name
let updatedInstance = genie.setItemName("My Product")
.setItemDescription("A new product to add")
.setBasePrice(parseFloat("12345.50"))
.setTotalSupply(parseInt("100"))
.setListCostingBreakdown(sampleCostingItems);

Helper: Clear all costing items breakdown

// Clear and empty List of Items included in the costing breakdown
let updatedInstance = genie.clearListCostingBreakdown();

Helper: Get the most expensive item from the costing breakdown

// Returns the most expensive item from the costing breakdown
const mostExpensiveItem = genie.getMostExpensiveCostItem();

🎛️ Step 2: Simulation Mode & Slider Implementation

PriceGenie allows you to simulate pricing strategies without affecting your original data. You can plug these into a visual UI using sliders for dynamic experimentation.

🔄 2.1 Toggle Simulation Mode

Enable or disable simulation mode for visual controls like sliders:

const handleToggleSimulationMode = (bool: boolean) => {
const updatedInstance = genie.toggleSimulation(bool);
 setGenieInstance(updatedInstance);
};

When enabled, simulated values (e.g., quantity, unit price) override base values only in calculations and UI, not in stored data.


🎚️ 2.2 Update Simulation Multipliers via Sliders

Each of these methods updates simulated multipliers that affect pricing computation in real time:

🔢 Cost Item Quantity

const handleSimDataQuantity = (multiplier: number, index?: number) => {
  if (!!genie && index !== undefined) {
    const updatedInstance = genie.updateCostItemQuantityMultiplier(index, multiplier);
    setGenieInstance(updatedInstance);
 
  }
};

💰 Cost Item Unit Price

const handleSimDataUnitPrice = (multiplier: number, index?: number) => {
  if (!!genie && index !== undefined) {
    const updatedInstance = genie.updateCostItemUnitPriceMultiplier(index, multiplier);
    setGenieInstance(updatedInstance);
  }
};

📦 Global Total Supply

const handleSimDataTotalSupply = (multiplier: number) => {
  if (!!genie) {
    const updatedInstance = genie.updateTotalSupplyMultiplier(multiplier);
    setGenieInstance(updatedInstance);
  }
};

🏷️ Global SRP (Suggested Retail Price)

const handleSimDataSRP = (multiplier: number) => {
  if (!!genie) {
    const updatedInstance = genie.updateSRPMultiplier(multiplier);
    setGenieInstance(updatedInstance);
  }
};

🧠 Use Cases

  • Freelancers quoting custom projects
  • Product makers computing ideal selling price
  • Startups experimenting with cost inputs
  • Visual apps needing real-time pricing logic

🚧 Coming Soon

  • CAPEX / OPEX breakdown support
  • Tax-aware calculations (e.g., VAT, withholding)

These features are not yet available in the current release but are in active development.


📁 Project Structure

.
├── src/               # Source TypeScript file
├── dist/              # Build output (generated)
├── demo/              # Optional usage demo (ignored in build)
├── README.md
├── package.json
└── tsconfig.json

📌 The /demo folder contains illustrative .tsx usage examples. It is excluded from the npm package and TypeScript build.


🤝 Contributing

Contributions, bug reports, and suggestions are welcome! Feel free to fork and open a pull request.


🧾 License

ISC — free for personal and commercial use.


🔗 Author

Made with 💙 by @thezelijah

About the Developer


Contact