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

@randajan/fio-api

v1.1.0

Published

Fio API for bank transactions with custom columns and date support.

Downloads

80

Readme

@randajan/fio-api

NPM JavaScript Style Guide

This package provides a simple interface for collecting transactions from a bank account using the Fio API. It can work with data in the "YYYY-MM-DD" format or Date instances. It also allows you to add custom columns and map their values using functions.

Installation

To install the package, use the following command:

yarn add @randajan/fio-api

Usage

import Fio from "@randajan/fio-api";

// Create an instance of Fio for the bank account with the given token
const fio = Fio.create("Your-account-ID", "Your-Fio-api-token");

// Get the latest transactions on the account
fio.paysLast((fio, pay) => {
    console.log("Transaction no.", index + 1);
    console.log("Date:", pay("Datum"));
    console.log("Amount:", pay("Objem"));
    console.log("Account number:", pay("Protiúčet"));
    // ... other transaction details ...
});

// Get transactions in a specific period
const fromDate = "2023-01-01";
const toDate = "2023-07-25";
fio.paysByPeriod(fromDate, toDate, (fio, pay) => {
    console.log("Transaction no.", index + 1);
    console.log("Date:", pay("Datum"));
    console.log("Amount:", pay("Objem"));
    console.log("Account number:", pay("Protiúčet"));
    // ... other transaction details ...
});

Documentation

Function Fio.create(accountId, token)

Creates an instance of Fio for the bank account with the specified accountId and Fio API token.

Method Fio.fetch(path)

Fetches data from the Fio API server for the given path. Returns a list of transactions on the account.

Method Fio.map(path, callback, ...a)

Fetches data from the Fio API server for the given path and performs data mapping using the callback function.

Method Fio.paysLast(callback, ...a)

Gets the latest transactions on the account and performs data mapping using the callback function.

Method Fio.paysByPeriod(fromDate, toDate, callback, ...a)

Gets transactions in a specific period and performs data mapping using the callback function.

Function toDateString(date)

Converts the given date to the "YYYY-MM-DD" format. It can also accept Date instances.

Function addColumnAlias(idOrAlias, ...aliases)

Adds aliases for the column with the given ID or alias.

Function addTrait(idOrAlias, trait)

Adds a custom getter (trait) for mapping the values of the column with the given ID or alias.

Function addUserAlias(user, alias)

Adds an alias for the user. By default it's used at trait

Function getUserAlias(user)

Get an alias for the user.

License

MIT

By using this package, you agree to the licensing terms.