0.1.6 • Published 8 months ago

kwsp-calculator v0.1.6

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

KWSP Calculator

CI Publish

NPM | DEMO

Non-official Malaysia KWSP (Kumpulan Wang Simpanan Pekerja) or EPF (Employees Provident Fund) calculator.

Getting Started

Installation

# npm
npm install kwsp-calculator --save

#yarn
yarn add kwsp-calculator

Get Monthly Contribution

import { getMonthlyContribution } from 'kwsp-calculator';

function main() {
  const kwspContribution = getMonthlyContribution(3000);

  console.log(kwspContribution);
}

main();
{
  "total": 630,
  "worker": 330,
  "employer": 300,
  "rate": {
    "worker": 11,
    "employer": 10
  }
}

Overwrite employer or worker contribution rate

import { getMonthlyContribution } from 'kwsp-calculator';

function main() {
  const kwspContribution = getMonthlyContribution(3000, 9, {
    overwriteEmployerRate: 15,
  });
  console.log(kwspContribution);
}

main();
{
  "total": 720,
  "worker": 270,
  "employer": 450,
  "rate": { "worker": 9, "employer": 15 }
}

Get KWSP Projection

import { getKWSPProjection } from 'kwsp-calculator';

function main() {
  const kwspProjection = getKWSPProjection({
    monthlySalary: 3000,
    annualSalaryIncrementPercentage: 0,
    kwspAnnualInterest: 6,
    currentKwspAmount: 50000,
    workerRate: 11,
    employerRate: 0,
    from: new Date('2022-01-01'),
    to: new Date('2023-01-01'),
  });

  console.log(getKWSPProjection);
}

main();
{
  "totalAmount": 57770.399307163374,
  "annual": [
    { "year": 2022, "amount": 3960, "dividendAmount": 3194.62617628195 },
    { "year": 2023, "amount": 330, "dividendAmount": 285.7731308814098 }
  ]
}
0.1.6

8 months ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.1.1

2 years ago