2.6.6 • Published 3 years ago

student-debt-calc v2.6.6

Weekly downloads
2
License
SEE LICENSE IN TE...
Repository
github
Last release
3 years ago

Student Debt Calculator

Build Status

A JavaScript package which calculates student debt at graduation based on a wide array of possible inputs.

This calculator does not simply calculate debt based on loans - given inputs of costs, grants, scholarships, personal savings, and loans, it can calculate how much of the annual cost of attendance is left to pay, total debt at graduation, and monthly payment at graduation, based on combined loans and given loan rates.

Currently in Beta

Dependencies

The package runs on node.js. It can be included in front-end projects as an npm package - see 'Installation' below.

Installation

  1. Install node.js
  2. Run npm install student-debt-calc --save

Usage

The intent of the package is to allow developers to perform calculations of student debt based on a standard set of costs, grants, scholarships, loans, and a set of constants.

This package can be required and used as a function. It takes in an Object, refered to in this documentation as the "financials Object" or as financials. It returns an Object as well, formatted nearly identically to Object it was passed, with values based on a set of calculations.

The Object taken in as a parameter and the Object returned are essentially the same Object, with a variety of calculations and corrections applied, and with properties updated with new values.

For instance, here is a sample of a "financials" Object that can be passed to the calculator:

var financials = {
    tuitionFees: 10000,
    roomBoard: 2000,
    books: 1000,
    transportation: 500,
    otherExpenses: 250,
    scholarships: 0,
    pell: 0,
    savings: 0,
    family: 0,
    perkins: 0,
    staffSubsidized: 0,
    staffUnsubsidized: 0,
    institutionalLoan: 0,
    privateLoan: 13750,
    undergrad: true
}

The financials object

The object passed to studentDebtCalculator is used to set up the calculations. Each property has a default value, so properties whose value does not need to be changed from the default can be omitted. Below, we list all the properties used in the calculations. They are separated by category for ease of reading.

Costs of Attendance

These values are all added together to get the cost of attendance. They are taken as separate values to match with the Financial Aid Shopping Sheet.

PropertyTypeDescriptionDefault value
financials.tuitionFeesnumberThe value of tuition and fees0
financials.roomBoardnumberThe cost of room and board0
financials.booksnumberThe cost of books0
financials.otherExpensesnumberThe cost of miscellaneous expenses0
financials.transportationnumberThe costs of transporation0

Grants and Scholarships

These values are deducted from cost of attendance.

PropertyTypeDescriptionDefault value
financials.scholarshipsnumberTotal value of scholarships0
financials.pellnumberTotal value of Pell grants0
financials.militaryTuitionAssistancenumberTotal value of Military Tuition Assistance0
financials.GIBillnumberTotal value of GI Bill0

Contributions

PropertyTypeDescriptionDefault value
financials.workstudynumberValue of work-study0
financials.savingsnumberTotal personal savings to be spent to reduce annual cost of attendance0
financials.familynumberTotal family contributions to be spent to reduce annual cost of attendance0
financials.parentPlusnumberFederal Parent PLUS loan amount (the interest for this loan is not added to student loan totals, but is calculated as a monthly payment in outputs as financials.loanMonthlyParent)0

Federal Loans

PropertyTypeDescriptionDefault value
financials.perkinsnumberAmount of federal Perkins loan0
financials.directSubsidizednumberAmount of federal Direct subsidized loan0
financials.directUnsubsidizednumberAmount of federal Direct unsubsidized loan0
financials.gradPlusnumberAmount of GradPlus loan0

Private Loans

PropertyTypeDescriptionDefault value
financials.institutionalLoannumberAmount of loan from institution0
financials.privateLoannumberAmount of private loan0
financials.privateLoanMultiArrayUsed for multiple private loans. This array should contain objects, with each object having two properties - amount for the amount of the loan, rate for the loan's rate expressed as a decimal, fees for the loan's fees expressed as a decimal (based on percent of amount), and deferPeriod for the number of months the loan is deferred. Example: [ { 'amount': 3000, 'rate': 0.061, 'fees': .01, deferPeriod': 6 }, { 'amount': 3600, 'rate': 0.059, 'fees': .0125, 'deferPeriod': 6 } ] Important note: If privateLoanMulti is not empty, then the values of privateLoanMulti are used and the value of privateLoan is ignored![] (empty array)

Loan rates

PropertyTypeDescriptionDefault value
financials.institutionalLoanRatenumberLoan rate for institutional loan, expressed as a decimal0.079
financials.privateLoanRatenumberLoan rate for private loan, expressed as a decimal0.079
financials.perkinsRatenumberLoan rate for federal Perkins loans0.05
financials.subsidizedRatenumberLoan rate for Direct subsidized loans0.0466
financials.unsubsidizedRateUndergradnumberLoan rate for Direct unsubsidized undergratuate loans0.0466
financials.unsubsidizedRateGradnumberLoan rate for Direct unsubsidized gratuate loans0.0621
financials.DLOriginationFeenumberOrigination fee for Direct loans1.01073
financials.gradPlusRatenumberLoan rate for GradPLUS loan0.0721
financials.parentPlusRatenumberLoan rate for ParentPLUS loan0.0721
financials.plusOriginationFeenumberOrigination fee for Plus loans1.04292

Maximums and Caps

These properties give the calculator caps and maximums on certain values.

PropertyTypeDescriptionDefault value
financials.perkinsUnderCapnumberCap on undergratuate Perkins loans5500
financials.perkinsGradCapnumberCap on graduate Perkins loans8000

Outputs

These properties are added to the returned Object and would generally be considered the "outputs" for the package.

PropertyTypeDescription
financials.firstYearNetCostnumberThe cost of attendance minus grants and scholarships
financials.moneyForCollegenumberThe total of grants, scholarships, and loans
financials.remainingCostnumberThe costs of attendance minus all grants, scholarships, and loans
financials.moneyForCollegenumberThe total of grants, scholarships, and loans
financials.loanMonthlynumberThe monthly loan payment based on the loans specified and financials.repaymentTerm
financials.loanLifetimenumberThe lifetime cost of the loans based on the loans specified and financials.repaymentTerm
financials.loanMonthlyParentnumberThe monthly loan payment of the federal Parent PLUS loan.

tenYear and twentyFiveYear properties

To make it easy to compare the difference between 10 and 25 year loan repayment terms, the Object returned by the package has two additional properties - financials.tenYear and financials.twentyFiveYear. These properties are Objects themselves with their own loanLifetime and associated values:

PropertyTypeDescription
financials.tenYear.loanMonthlynumberThe monthly loan payment with a 10 year repayment term
financials.tenYear.loanLifetimenumberThe lifetime cost of the loans with a 10 year repayment term
financials.twentyFiveYear.loanMonthlynumberThe monthly loan payment with a 25 year repayment term
financials.twentyFiveYear.loanLifetimenumberThe lifetime cost of the loan with a 25 year repayment term

Calculations, Caps, and Errors

When applied to the "financials" Object, the package first establishes some constants and determines which values should be used for a variety of numbers

  • for instance, based on whether the program is undergraduate or graduate, what the limits of some federal loans are.

The package then establishes scholarships and grants, checking against caps, and calculates the firstYearNetCost property based on those values (applying the grants and scholarships against the cost of attendance).

Then, the package applies loans to the remaining cost, ensuring these values are below the limits for federal loans.

After grants, scholarships, and loans are applied, the package determines the total money for college (moneyForCollege property) and the amount left to pay (remainingCost property).

Finally, the package calculates the debt at graduation (properties such as perkinsDebt or privateLoanDebt), the cost of the loans over the repayment term (loanLifetime property) and the monthly payment of the loans ('loanMonthly' property)

Along the way, the package also records and corrects "errors" - for instance, when the inputs exceed federal limits or the cost of attendance (in which case the values for these inputs are changed to equal the limit). These errors can be found in the errors property, which is an Object itself. The following table illustrates the "error codes" which are used as keys in the errors Object:

errors Object keyError
errors.pellOverCostsPell grant exceeds cost of attendance
errors.pellOverCapPell grant exceeds federal limit
errors.perkinsOverCostsPerkins loan exceeds cost of attendance
errors.perkinsOverCapPerkins loan exceeds federal limit
errors.mtaOverCapMilitary Tuition Assistance exceeds federal limit
errors.subsidizedOverCostsDirect subsidized loan exceeds cost of attendance
errors.subsidizedOverCapDirect subsidized loan exceeds federal limit
errors.unsubsidizedOverCostsDirect unsubsidized loan exceeds cost of attendance
errors.unsubsidizedOverCapDirect unsubsidized loan exceeds federal limit

How to test the software

Run tests with:

npm test

Getting help

If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.

License

The project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

Software source code previously released under an open source license and then modified by CFPB staff is considered a "joint work" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open-source license.

For further details, please see: http://www.consumerfinance.gov/developers/sourcecodepolicy/

2.6.6

3 years ago

2.6.5

5 years ago

2.6.4

6 years ago

2.6.3

7 years ago

2.6.2

7 years ago

2.6.0

8 years ago

2.5.13

8 years ago

2.5.12

8 years ago

2.5.11

8 years ago

2.5.10

8 years ago

2.5.9

8 years ago

2.5.8

8 years ago

2.5.7

8 years ago

2.5.6

8 years ago

2.5.5

8 years ago

2.5.4

8 years ago

2.5.3

8 years ago

2.5.2

8 years ago

2.5.1

8 years ago

2.5.0

8 years ago

2.4.1

8 years ago

2.4.0

8 years ago

2.3.0

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

9 years ago