New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

finlambda

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

finlambda

Functional programing library for financial calculations

  • 1.0.0-beta.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

finlambda

Travis

Is a JavaScript library for financial calculations designed to be used with functional programing paradigm.

It use Ramda.

Why finlambda

Build your custom calculator for taxes, compose it easily to using ramda.

example

Installation

npm install finlambda ramda@0.26.0

Node

Import all functions

const FinLambda = require('finlambda')

or individually

const { rateAt } = require('finlambda')

ES2015 or typescript

import { rateAt } from 'finlambda'

Browser

<script src="path/to/yourCopyOf/ramda.js></script>
<script src="path/to/yourCopyOf/finlambda.js></script>

Usage

create a complex tax

const bracket15 = compose(rateAt(0.15), forInterval(0, 38120))
const bracket28 = compose(rateAt(0.28), forInterval(38121))
const brackets = [bracket15, bracket28]
const corpTax = tax(brackets);
const afterCorpTax = netAfter(corpTax)
// calculate your tax
corpTax(100000)        //=> 23045
// calculate net amount after tax
afterCorpTax(100000)   //=> 76955

chain taxes

const flatTax = rateAt(0.30)
const afterFlatTax = netAfter(flatTax)

const withFlatTax = R.pipe(afterCorpTax, afterFlatTax)

withFlatTax(100000) //=> 53868.5

detailed tax output

const coprTaxDetailed = taxDetail(brackets)
corpTaxDetailed(100000) //=> [ 5718, 11726.12 ]

Keywords

FAQs

Package last updated on 26 Nov 2018

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