Skip to content

Financial calculations written in pure javascript

License

Notifications You must be signed in to change notification settings

alfreema/finance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


alfreema/finance

Financial calculations written in pure javascript

IntroductionHow To InstallHow To UseHow To CloneHow To Run TestsCreditsSupportLicense

Introduction

This is a pure javascript library of financial calculations derived from: https://github.com/ebradyjobory/finance.js

The key difference between the package above and this package are two-fold:

  1. All calculations are simple javascript functions that can be imported directly instead of through an object.
  2. The calculations are broken out into individual modules with individual test files

How To Install

To add these calculations to your node application, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Install this repository
$ npm install alfreema/finance

How To Use

In your node application, require the plugin and call the chosen function.

const { payment } = require('finance');

const rate = 2;
const numberOfPayments = 36;
const loanPrincipal = -1000000;

const resultPMT = Number(payment(rate, numberOfPayments, loanPrincipal).toFixed(2));
console.log(`expected result=39232.85\nactual result=${resultPMT}`)
// ...

How To Clone

If you would like a copy of the repository to review or run tests against you can clone the repository with:

# Clone the repository
$ git clone [email protected]:alfreema/finance

# Install dependencies
$ npm i

How To Run Tests

All functions are tested using the Jest testing framework. To run the tests:

# Run the tests
$ npm test

Note If you get any errors, please report them!

Credits

This software uses the following open source packages:

Support

Buy Me A Coffee

License

MIT


sendthisfile.com  ·  GitHub @alfreema

About

Financial calculations written in pure javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published