2.3.4 • Published 12 days ago

node-debt-snowball v2.3.4

Weekly downloads
3
License
MIT
Repository
github
Last release
12 days ago

node-debt-snowball

GitHub Workflow Status Depfu Codecov GitHub issues by-label GitHub

Node script to calculate debt repayment using the snowball method

Features

  • Fully tested with 100% code coverage
  • Module and CommonJS compatible
  • Nightly builds to evaluate accuracy
  • Lightweight - completely dependency free

Installation

npm install node-debt-snowball

Usage

Basic Usage

import snowball from 'node-debt-snowball';

const accounts = [
  {
    name: 'Credit Card',
    interest: 14.99,
    balance: 1000,
    minPayment: 75,
  },
  {
    name: 'Student Loan',
    interest: 4.75,
    balance: 7500,
    minPayment: 150,
  },
];
const additionalPayment = 100;

const repaymentPlan = snowball(accounts, additionalPayment);
console.log('repaymentPlan', repaymentPlan);

API

Full API documentation is available can be found at https://nielse63.github.io/node-debt-snowball

Response Schema

[
  {
    "balance": "number",
    "accounts": [
      {
        "name": "string",
        "balanceStart": "number",
        "balanceEnd": "number",
        "accruedInterest": "number",
        "additionalPayment": "number",
        "paymentAmount": "number"
      }
      // more accounts...
    ]
  }
  // more payment periods...
]

A full sample response can be found at examples/response.json.

Contributing

Clone the repo and install the dependencies:

git clone https://github.com/nielse63/node-debt-snowball.git
cd node-debt-snowball
npm ci

Prerequisites

Node v16.20.1:

nvm use v16.20.1

NPM Scripts

ScriptDescription
npm run lintLint and autofix source files
npm run buildCompile the TypeScript source to the dist directory
npm testRuns unit tests with Jest
npm run devExecutes the example script, saving the response to the file system
npm run docsBuilds the documentation
2.3.2

12 days ago

2.3.4

12 days ago

2.3.3

12 days ago

2.3.0

13 days ago

2.3.1

13 days ago

2.2.0

16 days ago

2.1.2

17 days ago

2.1.1

17 days ago

2.1.4

17 days ago

2.1.3

17 days ago

2.1.5

17 days ago

2.1.0

11 months ago

1.2.0

1 year ago

2.0.0

1 year ago

1.2.1

1 year ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago