
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
A new finance library for javascript. Intended to improve the workflow of JavaScript developers who are also in the finance industry. The package includes nice helper functions to quickly get values for ratio analysis, time value of money, managerial calculations etc.
Currently version 1.x.x only has Time Value of Money
npm install businessjs
<script src="https://cdn.jsdelivr.net/npm/businessjs@1.2.1/build/index.min.js"></script>
This will give you the package available for use in any front-end or Node.js environment.
Import syntax:
import businessjs from 'businessjs';
In node environment:
const businessjs = require('businessjs');
const tvm = businessjs.tvm;
Using the CDN is recommended though.
<!DOCTYPE html>
<html>
<head>
<script src="node_modules/businessjs/build/index.js"></script>
</head>
<body></body>
</html>
This should create the instance globally on the window
<script>
const tvm = businessjs.tvm;
</script>
Methods
futureValue = function(presentValue, interest, [numPeriods = 1, perPeriod = 1])
numPeriods
defaults to 1 as in 1 year.perPeriod
The amount of times an interest rate is compounded defaults to 1.presentValue = function(futureValue, interest, [numPeriods = 1, perPeriod = 1])
numPeriods
defaults to 1 as in 1 year.perPeriod
The amount of times an interest rate is compounded defaults to 1.numPeriods = function(presentValue, futureValue, interest, [perPeriod = 1])
perPeriod
The amount of times an interest rate is compounded defaults to 1.interest = function(presentValue, futureValue, [numPeriods = 1, perPeriod = 1])
numPeriods
defaults to 1 as in 1 year.perPeriod
The amount of times an interest rate is compounded defaults to 1.futureValueAnnuityDue = function(payment, interest, [numPeriods = 1, perPeriod = 1])
numPeriods
defaults to 1 as in 1 year.perPeriod
The amount of times an interest rate is compounded defaults to 1.futureValueAnnuityAdvance = function(payment, interest, [numPeriods = 1, perPeriod = 1])
numPeriods
defaults to 1 as in 1 year.perPeriod
The amount of times an interest rate is compounded defaults to 1.presentValueAnnuityDue = function(payment, interest, [numPeriods = 1, perPeriod = 1])
numPeriods
defaults to 1 as in 1 year.perPeriod
The amount of times an interest rate is compounded defaults to 1.presentValueAnnuityAdvance = function(payment, interest, [numPeriods = 1, perPeriod = 1])
numPeriods
defaults to 1 as in 1 year.perPeriod
The amount of times an interest rate is compounded defaults to 1.effectiveRate = function(nominalRate, perPeriod)
const tvm = require('businessjs').tvm;
// Convert the monthly nominal rate to yearly effective inline
tvm.futureValue(100, tvm.effectiveRate(0.1, 12), 1, 1);
amortisation = function(presentValue, interest, [numPeriods=1, perPeriod=12])
{
period,
payment,
interestPortion,
principlePortion,
totalBalance,
principleBalance
}
numPeriods
defaults to 1 as in 1 year.perPeriod
The amount of times an interest rate is compounded defaults to 12 payments per year.These are just the first few methods in version 1, Documentation will be updated as version improves.
FAQs
Fast and accurate business and financial calculations in JavaScript.
We found that businessjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.