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

wf-finance-toolbox

v1.0.1

Published

Finance utility library for Node.js

Downloads

3

Readme

wf-finance-toolbox

Finance utility library for Node.js

Index

Installation

  • This library/package can be easily installed by running npm install wf-finance-toolbox --save

Dependencies

  • Node modules:
    • There's no dependencies in this library

Examples

  • Using javascript
const { wfFinanceToolbox } = require('wf-finance-toolbox');
const calculator = new wfFinanceToolbox;

const present_value = 1000;
const future_value = 1000;
const monthly_interest_rate = 1;
const yearly_interest_rate = 10;
const periods = 12;
const payment = 100;
const payment_type_begin = 0;
const payment_type_end = 1;
const loan_amount = 50000;

const calculatedFutureValue = calculator.calculateFV(present_value, monthly_interest_rate, periods);
console.log('calculatedFutureValue: ', calculatedFutureValue); //Expected output: 1126.8250 ...

const calculatedPresentValue = calculator.calculatePV(future_value, monthly_interest_rate, periods);
console.log('calculatedPresentValue: ', calculatedPresentValue); //Expected output: 887.4492 ...

const calculatedFutureWithPaymentAtBegin = calculator.calculateFVwithPayments(present_value, payment, payment_type_begin, monthly_interest_rate, periods);
console.log('calculatedFutureWithPaymentAtBegin: ', calculatedFutureWithPaymentAtBegin); //Expected output: 2407.7578 ...

const calculatedFutureWithPaymentAtEnd = calculator.calculateFVwithPayments(present_value, payment, payment_type_end, monthly_interest_rate, periods);
console.log('calculatedFutureWithPaymentAtEnd: ', calculatedFutureWithPaymentAtEnd); //Expected output: 2395.0753 ...

const calculatedPayment = calculator.calculatePayment(loan_amount, monthly_interest_rate, periods);
console.log('calculatedPayment: ', calculatedPayment); //Expected output: 4442.4394 ...

const yearlyRateFromMonthlyRate = calculator.convertMontlhyRateToYearlyRate(monthly_interest_rate);
console.log('yearlyRateFromMonthlyRate: ', yearlyRateFromMonthlyRate); //Expected output: 0.1268 ...

const monthlyRateFromYearlyRate = calculator.convertYearlyRateToMontlhyRate(yearly_interest_rate);
console.log('monthlyRateFromYearlyRate: ', monthlyRateFromYearlyRate); //Expected output: 0.0079 ...

//An overall rate of 50% in 18 months converted to a monthly rate
const convertedRate = calculator.convertRateBasedOnPeriods(50, 18, 1);
console.log('convertedRate: ', convertedRate); //Expected output: 0.0227 ...

//An overall rate of 50% in 18 months converted to a bi-monthly rate
const convertedRateBiMonthly = calculator.convertRateBasedOnPeriods(50, 18, 2);
console.log('convertedRate: ', convertedRateBiMonthly); //Expected output: 0.0460 ...

const sacTable = calculator.calculateSACTable(loan_amount, monthly_interest_rate, periods);
console.log('sacTable: ', sacTable); //Expected output
[
  [1, 4666.67, 4166.67, 500, 45833.33],
  [2, 4625, 4166.67, 458.33, 41666.67],
  [3, 4583.33, 4166.67, 416.67, 37500],
  [4, 4541.67, 4166.67, 375, 33333.33],
  [5, 4500, 4166.67, 333.33, 29166.67],
  [6, 4458.33, 4166.67, 291.67, 25000],
  [7, 4416.67, 4166.67, 250, 20833.33],
  [8, 4375, 4166.67, 208.33, 16666.67],
  [9, 4333.33, 4166.67, 166.67, 12500],
  [10, 4291.67, 4166.67, 125, 8333.33],
  [11, 4250, 4166.67, 83.33, 4166.67],
  [12, 4208.33, 4166.67, 41.67, 0]
]

const priceTable = calculator.calculatePRICETable(loan_amount, monthly_interest_rate, periods);
console.log('priceTable: ', priceTable); //Expected output
[
  [1, 4442.44, 3942.44, 500, 46057.56],
  [2, 4442.44, 3981.86, 460.58, 42075.7],
  [3, 4442.44, 4021.68, 420.76, 38054.01],
  [4, 4442.44, 4061.9, 380.54, 33992.11],
  [5, 4442.44, 4102.52, 339.92, 29889.6],
  [6, 4442.44, 4143.54, 298.9, 25746.05],
  [7, 4442.44, 4184.98, 257.46, 21561.07],
  [8, 4442.44, 4226.83, 215.61, 17334.25],
  [9, 4442.44, 4269.1, 173.34, 13065.15],
  [10, 4442.44, 4311.79, 130.65, 8753.36],
  [11, 4442.44, 4354.91, 87.53, 4398.45],
  [12, 4442.44, 4398.45, 43.98, 0]
]
  • Using typescript
import { wfFinanceToolbox } from 'wf-finance-toolbox'
const calculator = new wfFinanceToolbox()

Use cases are the same as presented in the javascript block above

License

  • This library is licensed under GNU General Public License v.3.0
  • Please check the license content here

Uninstallation

  • This library/package can be easily uninstalled by running npm uninstall wf-finance-toolbox