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

financial

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

financial

A Zero-dependency TypeScript/JavaScript port of numpy-financial

  • 0.0.14
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.8K
increased by1.6%
Maintainers
1
Weekly downloads
 
Created
Source

Financial

npm version CI codecov Documentation

A Zero-Dependency TypeScript / JavaScript financial utility library inspired by numpy-financial that can be used on both Node.js and the browser.

It does support the same functionality offered by numpy-financial but it only support scalar values (no numpy-like array values) and it does not support decimal values.

📖 API DOCS 📖 : financialjs.netlify.app

Install

With npm:

npm install --save-dev financial

Or, with yarn:

yarn add financial

Example usage

import { fv } from 'financial'

fv(0.05 / 12, 10 * 12, -100, -100) // 15692.928894335748

Module formats

This library exports its functionality using different module formats.

Commonjs

const financial = require('financial') // ./index.js

// use `financial.fv`, `financial.pmt`, etc.

or, leveraging destructuring

const { fv, pmt } = require('financial') // ./index.js

// use `fv`, `pmt`, etc.

An optimized Commonjs for browsers can be imported directly from the web:

<script src="https://www.npmcdn.com/financial@x.y.z/dist/financial.cjs.production.min.js"></script>

Note: make sure you replace the x.y.z with the correct version you want to use.

ESM (EcmaScript Modules)

Also working with Typescript

import { fv, pmt } from 'financial'

// use `fv`, `pmt`, etc.

There's no default export in the ESM implementation, so you have to explicitely import the functionality you need, one by one.

Implemented functions

  • fv
  • pmt
  • nper
  • ipmt
  • ppmt
  • pv
  • rate
  • irr
  • npv
  • mirr

Local Development

Below is a list of commands you will probably find useful.

  • npm start or yarn start: Runs the project in development/watch mode. Your project will be rebuilt upon changes.
  • npm run build or yarn build: Bundles the package to the dist folder. The package is optimized and bundled with Rollup into multiple format (CommonJS, UMD, and ES Module).
  • npm run build:docs or yarn build:docs: Builds the API documentation in the docs folder using typedoc.
  • npm test or yarn test: Runs the test watcher (Jest) in an interactive mode. it runs tests related to files changed since the last commit.
  • npm run test:watch or yarn test:watch: runs the tests in watch mode

Contributing

Everyone is very welcome to contribute to this project. You can contribute just by submitting bugs or suggesting improvements by opening an issue on GitHub.

You can also submit PRs as long as you adhere with the code standards and write tests for the proposed changes.

License

Licensed under MIT License. © Luciano Mammino.

Keywords

FAQs

Package last updated on 01 Jul 2020

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