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

smartmoney77-calculators

v1.0.0

Published

15+ financial calculator functions — compound interest, FIRE, budget planning, credit payoff, inflation, zakat & more. Used by SmartMoney77.com.

Readme

smartmoney77-calculators

15+ financial calculator functions for Node.js and the browser. Zero dependencies, fully typed.

Used by SmartMoney77.com — free financial calculators in 6 languages.

Install

npm install smartmoney77-calculators

Functions

| Function | Description | |---|---| | compound() | Compound interest with monthly contributions | | fire() | FIRE (Financial Independence) target calculator | | fireYears() | Years to reach a savings target | | monthlyToTarget() | Monthly savings needed for a goal | | costOfWaiting() | Cost of delaying investments | | latteFactor() | Small daily expenses compounded over time | | workHours() | How many work hours a purchase costs | | feeImpact() | Long-term impact of investment fees | | inflation() | Purchasing power erosion over time | | creditPayoff() | Credit card payoff timeline | | creditInterest() | Total interest on credit card balance | | emergencyFund() | Emergency fund target and gap analysis | | emergencyGap() | Emergency fund gap amount | | educationRoi() | Return on investment of education | | zakat() | Islamic Zakat obligation calculator |

Quick Start

import { compound, fire, latteFactor } from 'smartmoney77-calculators';

// Compound interest: $10k initial + $500/mo at 7% for 20 years
const result = compound(10000, 500, 7, 20);
console.log(result.futureValue);    // ~268,549
console.log(result.totalInterest);  // ~138,549

// FIRE calculator: $40k/yr expenses, $100k saved, $2k/mo, 7% return
const fireResult = fire(40000, 100000, 2000, 7);
console.log(fireResult.targetAmount);  // 1,000,000
console.log(fireResult.yearsToFire);   // ~15.8

// Latte Factor: $5/day coffee invested at 7% for 30 years
const latte = latteFactor(5, 7, 30);
console.log(latte.investedValue);  // ~182,000+

API

Every function accepts plain numbers and returns a typed result object. All monetary values are rounded to 2 decimal places.

Rates are always expressed as percentages (e.g., 7 for 7%, not 0.07).

compound(principal, monthlyContribution, annualRate, years)

Returns { futureValue, totalContributions, totalInterest }

fire(annualExpenses, currentSavings, monthlyContribution, annualReturn)

Returns { targetAmount, yearsToFire, monthlyRequired }

fireYears(currentSavings, monthlyContribution, annualReturn, target)

Returns number (years as decimal)

monthlyToTarget(currentSavings, annualReturn, years, target)

Returns number (required monthly contribution)

costOfWaiting(monthlyContribution, annualReturn, years, delayYears)

Returns { ifStartNow, ifWait, costOfWaiting }

latteFactor(dailyAmount, annualReturn, years)

Returns { dailyCost, monthlyCost, yearlyCost, investedValue }

workHours(annualSalary, hoursPerWeek, itemCost, taxRate?)

Returns { hoursPerItem, itemsPerHour, effectiveHourlyRate }

feeImpact(principal, monthlyContribution, annualReturn, annualFee, years)

Returns { withoutFees, withFees, feeCost, feePercentageOfGains }

inflation(currentAmount, inflationRate, years)

Returns { futureNominalValue, futurePurchasingPower, purchasingPowerLoss }

creditPayoff(balance, annualRate, monthlyPayment)

Returns { monthsToPayoff, totalPaid, totalInterest }

creditInterest(balance, annualRate, months)

Returns number (total interest)

emergencyFund(monthlyExpenses, targetMonths?, currentSavings?, monthlySavings?)

Returns { targetAmount, currentAmount, gap, monthsToFill }

emergencyGap(monthlyExpenses, targetMonths, currentSavings)

Returns number (gap amount)

educationRoi(tuitionCost, yearsOfStudy, currentSalary, expectedSalary, opportunityCost?)

Returns { totalCost, salaryIncrease, paybackYears, tenYearRoi, roiPercentage }

zakat(cashAndBank, goldValue?, silverValue?, investments?, otherAssets?, liabilities?, goldPricePerGram?)

Returns { totalWealth, nisabThreshold, isZakatDue, zakatAmount }

License

MIT — SmartMoney77.com