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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@founderpath/financets

v1.2.1

Published

Finance.ts is a library for financial calculations

Downloads

804

Readme

Finance.ts

Introduction

Finance.ts makes it easy to incorporate common financial calculations into your application. The library is built in Typescript without any dependencies.

This is a fork of https://github.com/ebradyjobory/finance.js.

Major differences:

  • Written in Strict Typescript
  • ESM and CJS compatible
  • No more classes, just pure functions
  • Functions are written without using arguments and rest parameters
  • Functions with more than 3 parameters uses object parameters instead
  • Functions uses booleans and enums instead of integer flags

Getting Started

npm install @founderpath/financets --save

Example Usage

import { AM } from "@founderpath/financets"

AM({
  principal: 20000,
  rate: 7.5,
  period: 5,
  yearOrMonth: "year",
  payAtBeginning: false,
});
// => 400.76

Available Functions

These are the available functions. Please refer to the typescript definition itself and/or tests for usage.

AM Amortization

Amortization (AM) is the paying off of debt with a fixed repayment schedule in regular installments over a period of time.

CAGR Compound Annual Growth Rate

Compound Annual Growth Rate (CAGR) is the year-over-year growth rate of an investment over a specified period of time.

CAPM Capital Asset Pricing Model

Capital Asset Pricing Model (CAPM) describes the relationship between systematic risk, or the general perils of investing, and expected return for assets, particularly stocks.

CI Compound Interest

Compound Interest (CI) is the interest calculated on the initial principal and also on the accumulated interest of previous periods of a deposit or loan.

DF Discount Factor

Discount Factor (DF) is the factor by which a future cash flow must be multiplied in order to obtain the present value.

FV Future Value

Future Value (FV) is the value of an asset or cash at a specified date in the future that is equivalent in value to a specified sum today

IAR Inflation-adjusted return

Inflation-adjusted return (IAR) measures the return taking into account the time period's inflation rate

IRR Internal Rate of Return

Internal Rate of Return (IRR) is the discount rate often used in capital budgeting that makes the net present value of all cash flows from a particular project equal to zero.

LR Leverage Ratio

Leverage Ratio (LR) is used to calculate the financial leverage of a company or individual to get an idea of the methods of financing or to measure ability to meet financial obligations.

NPV Net Present Value

Net Present Value (NPV) compares the money received in the future to an amount of money received today, while accounting for time and interest [through the discount rate]. It's based on the principal of time value of money (TVM), which explains how time affects monetary value.

PI Profitability Index

Profitability Index (PI) is an index that attempts to identify the relationship between the costs and benefits of a proposed project through the use of a ratio calculated.

PMT Loan Payment per Period

Loan Payment per Period (PMT) calculates payment for a loan based on constant payments and a constant interest rate

PP Payback Period

Payback Period (PP) is the length of time required to recover the cost of an investment.

PV Present Value

Present Value (PV) is the current worth of a future sum of money or stream of cash flows given a specified rate of return

R72 Rule of 72

Rule of 72 (R72) is a rule stating that in order to find the number of years required to double your money at a given interest rate, you divide the compound return into 72.

ROI Return on Investment

Return on Investment (ROI) is a simple calculation that tells you the bottom line return of any investment.

WACC Weighted Average Cost of Capital

Weighted Average Cost of Capital (WACC) is the rate that a company is expected to pay on average to all its security holders to finance its assets.

XIRR Irregular Internal Rate of Return

XIRR is used to determine the Internal Rate of Return when the cash flows are at Irregular intervals.