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

finworth

v0.7.0

Published

Indian financial calculators — MF, Stocks, FD, RD, PPF, NPS, EMI, Tax. Zero dependencies. Works in React, React Native, Node.js.

Readme

finworth

Complete Indian financial calculator library for JavaScript & TypeScript. Works in React, React Native, and Node.js.

npm install finworth

Zero dependencies. Full TypeScript types. 21 tests.

Also available as a Python package on PyPI.


What's Inside

| Module | Calculators | |--------|------------| | Core | XIRR, CAGR, absolute return, inflation-adjusted return | | Mutual Funds | SIP maturity, SWP projection, capital gains (LTCG/STCG) | | Fixed Deposits | Maturity, post-tax returns | | Recurring Deposits | Maturity with quarterly compounding | | PPF | 15-year maturity calculator | | NPS | Corpus projection, monthly pension | | EPF | Corpus with employer match and increments | | EMI | Monthly EMI, year-wise amortization | | Gratuity | Payment of Gratuity Act (private + government) | | Salary | HRA exemption | | Planning | SSY, lumpsum, future cost, retirement corpus | | Stocks | P&L with all charges (STT, GST, stamp duty, SEBI, DP) | | Tax | Income tax slabs (old + new regime), STT |

All calculations follow Indian tax rules (FY 2024-25).


Quick Start

import { sipMaturity, emi, incomeTaxSlab, stockPnl, fdMaturity } from 'finworth';

// SIP — ₹10K/month at 12% for 10 years
sipMaturity(10000, 0.12, 10)
// → { invested: 1200000, returns: 1123391, maturity: 2323391 }

// EMI — ₹50L home loan at 8.5% for 20 years
emi(5000000, 0.085, 20)
// → { emi: 43391, totalPayment: 10413816, totalInterest: 5413816 }

// Income Tax — new regime
incomeTaxSlab(1500000, 'new')
// → { totalTax: 130000, effectiveRate: 0.086667 }

// Stock P&L with all charges
stockPnl(500, 580, 200, 'delivery')
// → { grossPnl: 16000, netPnl: 15798.08, charges: { stt: 116, gst: 8.35, ... } }

// FD maturity
fdMaturity(500000, 0.07, 3)
// → { maturity: 615720, interestEarned: 115720, effectiveRate: 0.071859 }

All Functions

Core

xirr(cashflows: [Date, number][])                    // XIRR for irregular cashflows
cagr(initial: number, final: number, years: number)  // Compound annual growth rate
absoluteReturn(invested: number, current: number)     // Simple return
inflationAdjusted(nominalReturn: number, inflation: number)

Mutual Funds

sipMaturity(monthly: number, rate: number, years: number)
swpProjection(corpus: number, monthlyWithdrawal: number, rate: number, years: number)
mfCapitalGains(buyNav: number, sellNav: number, units: number, holdingDays: number, fundType?: 'equity' | 'debt')

FD & RD

fdMaturity(principal: number, rate: number, years: number, compounding?: 'quarterly' | 'monthly' | 'half-yearly' | 'yearly')
fdPostTax(principal: number, rate: number, years: number, taxSlab?: number)
rdMaturity(monthly: number, rate: number, years: number)

PPF, NPS, EPF

ppfMaturity(yearly: number, rate?: number, years?: number)
npsMaturity(monthly: number, rate?: number, years?: number, annuityPercent?: number)
epfMaturity(basicDa: number, rate?: number, years?: number, annualIncrement?: number)

EMI & Gratuity

emi(principal: number, rate: number, years: number)
emiAmortization(principal: number, rate: number, years: number)
gratuity(basicDa: number, yearsOfService: number, employeeType?: 'private' | 'government')

Salary & Planning

hraExemption(basic: number, hraReceived: number, rentPaid: number, metro?: boolean)
ssyMaturity(yearly: number, rate?: number, depositYears?: number)
lumpsumMaturity(amount: number, rate: number, years: number)
futureCost(currentCost: number, inflation?: number, years?: number)
retirementCorpus(monthlyExpense: number, currentAge?: number, retirementAge?: number)

Stocks & Tax

stockPnl(buyPrice: number, sellPrice: number, quantity: number, tradeType?: 'delivery' | 'intraday')
stt(value: number, tradeType?: 'equity_delivery' | 'equity_intraday' | 'futures' | 'options')
incomeTaxSlab(income: number, regime?: 'old' | 'new', fy?: string)

Usage in React / React Native

import { sipMaturity, emi } from 'finworth';

function SIPCalculator({ monthly, rate, years }) {
  const result = sipMaturity(monthly, rate, years);
  return <Text>Maturity: ₹{result.maturity.toLocaleString('en-IN')}</Text>;
}

Tax Rules Applied

| Rule | Implementation | |------|---------------| | Equity LTCG (>1 year) | 12.5% above ₹1.25L exemption | | Equity STCG (≤1 year) | 20% flat | | STT (delivery) | 0.1% on sell side | | Income tax (new regime) | 0/5/10/15/20/30% slabs, ₹75K std deduction | | Section 87A rebate | No tax up to ₹7L (new regime) | | Gratuity | 15/26 formula, ₹20L tax-exempt cap | | PPF | 7.1%, tax-free | | NPS | Min 40% annuity | | EPF | 8.1%, 12% employee + 3.67% employer |


MCP Server (Claude, Kiro, Cursor)

Add to .mcp.json — any AI agent can call all finworth calculators as native tools:

{
  "finworth": {
    "command": "npx",
    "args": ["-y", "finworth", "--mcp"]
  }
}

Or if installed globally:

{
  "finworth": {
    "command": "finworth-mcp"
  }
}

20 tools exposed: SIP, FD, RD, PPF, NPS, EPF, EMI, gratuity, HRA, income tax, stock P&L, capital gains, SWP, SSY, lumpsum, future cost, retirement, XIRR, CAGR.


Contributing

PRs welcome. Ideas:

  • [ ] Workflows (financial health check, investment comparison)
  • [ ] Gold/Silver returns
  • [ ] Crypto tax (30% + 1% TDS)

License

MIT


Built by Vikas Singh