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

cashflow-projections

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cashflow-projections

JS utilities helping to generate cashflow projections

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

🚀 Cashflow projections

NPM Version Build Status Docs

This javascript module lets you easily generate projections

For example:

getCashflowProjections({ //full set of args: https://pmunin.github.io/cashflow-projections.js/modules.html#CashflowArgs
  startDate:new Date('01/01/2020'),
  periods: 24,
  accruals:{
    salary:()=>120000/12,
    tax:cf=>({amount:-cf.salary*0.25, description:'tax'}),
    bonus:cf=>cf.date.getMonth()==11?5000:undefined
  },
  totals:{
    salary: cf=>cf.accruals.salary.amount + (cf.previous[0]?.totals.salary??0)
  }
})

Generates array of:

[
  {date:new Date('01/01/2021'), period:1, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:10000}}},
  {date:new Date('02/01/2021'), period:2, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:20000}}},
  {date:new Date('03/01/2021'), period:3, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:30000}}},
  {date:new Date('04/01/2021'), period:4, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:40000}}},
  {date:new Date('05/01/2021'), period:5, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:50000}}},
  {date:new Date('06/01/2021'), period:6, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:60000}}},
  {date:new Date('07/01/2021'), period:7, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:70000}}},
  {date:new Date('08/01/2021'), period:8, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:80000}}},
  {date:new Date('09/01/2021'), period:9, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:90000}}},
  {date:new Date('10/01/2021'), period:10, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:100000}}},
  {date:new Date('11/01/2021'), period:11, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}}, totals:{salary:{amount:11000}}},
  {date:new Date('12/01/2021'), period:12, accruals:{salary:{amount:10000}, tax:{amount:2500, description:'tax'}, bonus:{amount:5000}}, totals:{salary:{amount:120000}}},
]

//accruals and totals are actually arrays, but it also have properties defined in the accrual configuration specified in properties keys

Read more docs here

Keywords

FAQs

Package last updated on 19 Jul 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