# index-inflation-calculator

> Calculate the next upcomming probability from previous year numbers.

Latest version **1.0.5** (published 2021-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install index-inflation-calculator
pnpm add index-inflation-calculator
yarn add index-inflation-calculator
bun add index-inflation-calculator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-01-10 |
| First published | 2021-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Milan Mooibroek |
| Maintainers | milan-mooibroek |
| Keywords | Inflation calculator, Excpected returns calculator, Index inflation calculator, Index returns calculator |

## Links

- npm: https://www.npmjs.com/package/index-inflation-calculator
- Repository: https://github.com/milan-mooibroek/index-inflation-calculator
- Homepage: https://github.com/milan-mooibroek/index-inflation-calculator#readme
- Issues: https://github.com/milan-mooibroek/index-inflation-calculator/issues
- npm.io page: https://npm.io/package/index-inflation-calculator

## Recent versions

- 1.0.5 (latest) — 2021-01-10
- 1.0.4 — 2021-01-10
- 1.0.3 — 2021-01-10
- 1.0.2 — 2021-01-10
- 1.0.1 — 2021-01-10
- 1.0.0 — 2021-01-08

## README

# Index inflation calculator

The index-inflation-calculator package is a tool to calculate upcomming year values of given purchase year and amount.

## Installation

Use the package manager [npm](https://www.npmjs.com/get-npm) to install index-inflation-calculator package.

```bash
npm index-inflation-calculator -s
```

## Usage

```javascript
const indexInflationCalculator = require('index-inflation-calculator');
const previousYearsData = [
    {year: 2010, rates: [107.2, 106.5, 106.5, 106.2]},
    {year: 2013, rates: [101]},  
];
const indexCalculator = new indexInflationCalculator(previousYearsData);
const returnOnBoughtHouse = indexCalculator.calculate(250000, 2025);
console.dir(returnOnBoughtHouse, { depth: null });
```

You can add an array or single value to split quarter results or yearly results in the rates value, Years must be unique. The rates are percentage based.

## Examples
```javascript
const indexInflationCalculator = require('index-inflation-calculator');
const previousYearsData = [
    {year: 2010, rates: [107.2, 106.5, 106.5, 106.2]},
    {year: 2013, rates: [101]},  
];
const indexCalculator = new indexInflationCalculator(previousYearsData);
const returnOnBoughtHouse = indexCalculator.calculate(250000, 2025);
console.dir(returnOnBoughtHouse, { depth: null });
//This log will be : 
// {
//     years: 4,
//     results: {
//       total: 290221.393284,
//       yearlyTotals: [
//         { year: 2021, total: 259500 },
//         { year: 2022, total: 269361 },
//         { year: 2023, total: 279596.718 },
//         { year: 2024, total: 290221.393284 }
//       ]
//     }
//   }
```

## License
[MIT](https://choosealicense.com/licenses/mit/)

---
_Source: https://npm.io/package/index-inflation-calculator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
