@webcarrot/xirr
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

xirr · GitHub license · npm version · JSR

JavaScript implementation of the XIRR LibreOffice function. It should give the same results as equivalents from LibreOffice Calc, MS Excel, Google Spreadsheet etc.

Usage

import { xirr, CashFlow } from "@webcarrot/xirr";

const flows: Array<CashFlow> = [
  {
    amount: 100,
    date: new Date("2019-02-02"),
  },
  {
    amount: -120,
    date: new Date("2019-03-02"),
  },
];

try {
  console.log("XIRR:", xirr(flows), "of", flows);
} catch (err) {
  console.log(err);
}

Readme

Keywords

Package Sidebar

Install

npm i @webcarrot/xirr

Weekly Downloads

2,000

Version

3.0.1

License

MIT

Unpacked Size

21.9 kB

Total Files

11

Last publish

Collaborators

  • webcarrot