Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

investment-math

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

investment-math

A node.js package to solve investment calculations.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by700%
Maintainers
1
Weekly downloads
 
Created
Source

Investment Math

A node.js package to solve investment calculations.

Functions

Calculate Compound Interest

Calculate a compound interest of a investment with constant deposits.

Example:

var investmentMath = require('investment-math')

investmentMath.calculateCompoundInterest({
  frequentDeposit: 1000,
  initialAmount: 10000,
  interestRate: 0.5,
  investmentDuration: 6,
  interestRateInterval: 'monthly',
  investmentDurationInterval: 'monthly',
})

// {
//   monthlyEarnings: [
//     {
//       monthEarnings: 49.99999999999818,
//       monthValue: 11049.999999999998,
//       month: 2
//     },
//     ...
//   ],
//   investmentValue: 16000,
//   totalEarnings: 379.2769726907718,
//   totalValue: 16379.276972690772
// }

Calculate future value

Calculate value of a current asset at a future date based on an assumed rate of growth

var investmentMath = require('investment-math')

let presentValue = 10000
let rate = 0.8
let time = 12
investmentMath.futureValue(presentValue, rate, time)

// 11003.386937161464

Contributing

Feel free to add issues with bugs or ideas. Any pull requests are very welcome!

Keywords

FAQs

Package last updated on 25 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc