npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

easy-personal-finance

v3.3.0

Published

Simple, friendly and poweful engine to manage your personal finances easily

Downloads

14

Readme

Easy Personal Finance

Simple, friendy and powerful engine to manage personal finances easily. Great tool to be used by web apps or cli apps.

Installation

Use npm package manager to install Easy Personal Finance

npm install easy-personal-finance
npm install easy-personal-finance@latest

Usage

In this moment this library offers two components (transactions & reports "new in version 3.1.0") To instance library

import { EasyFinance } from 'easy-personal-finance'

Transactions component usage

If we want to use the library to get the transactions from a FormData object used in to upload files in an http request then we could use the library as follows.

const transactionsDraft = new EasyFinance()
  .transactions
  .withType('form-data')
  .withData({
    body: req.body,
    contentTypeHeader: req.headers['content-type']!,
  })
  .build()
  .find({ text: searchParam })
  • req: Request object using Nextjs Api as a library client.
  • form-data: Indicates the type of source from which the financial data comes from.
  • searchParam: Search string entered by the user to search for specific transactions. More examples watching test

Format valid files

Json format file

[
  {
    "date": "01/01/2022",
    "concept": "Transferencia bancaria",
    "movement": "Alquiler",
    "amount": "-1500",
    "notes": "ALQUILER ENERO o no"
  },
  {
    "date": "02/01/2022",
    "concept": "Pago con tarjeta",
    "movement": "Supermercado",
    "amount": "-100",
    "notes": "COMPRAS SEMANALES"
  },
  {
    "date": "05/01/2022",
    "concept": "Ingreso",
    "movement": "Nómina",
    "amount": "3000",
    "notes": "SALARIO ENERO"
  }
]

Csv format file

;Fecha;F.Valor;Concepto;Movimiento;Importe;Divisa;Disponible;Divisa;Observaciones;;;;Total ingresos;Total Gastos;Resultado
;31/01/2023;29/01/2023;ventas.com;Pago con tarjeta;-16.41;EUR;24800.46;EUR;4940197132993006 ventas.xom*1O3Y69XQ4;;;;2471.43;-2762.98;-291.55
;31/01/2023;31/01/2023;Cargo por amortizacion de prestamo/credito; ;-700.83;EUR;4816.87;EUR;9132-1528-57-0230106506;;;;;;
;30/01/2023;30/01/2023;Abono de nómina;"MyEmpresa; S.L";2380.43;EUR;25153.7;EUR;"MyEmpresa; S.L";;;;;;

Reports component usage

If you want to get a balance sheet report calculated from a set of transactions then you have to do the following.

  async getBalance() {
    const financeEntities = await this.service.getTransactions()

    const reportService = new EasyFinance().reports
      .withType('balance')
      .withData(financeEntities)
      .build() as BalanceSheetService

    return reportService.calculateReport()
  }
  • financeEntities: represents the set of transactions to be usd to calculate report.
  • .reports.: path to use reports component
  • 'balance' type: indicates that the report to be generated should be a balance report.
  • calculateReport: method responsable to calculate report.