Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andremiras/laboral-kutxa.js
Unofficial Laboral Kutxa JS library
https://github.com/andremiras/laboral-kutxa.js
banco bank kutxa laboral
Last synced: 3 days ago
JSON representation
Unofficial Laboral Kutxa JS library
- Host: GitHub
- URL: https://github.com/andremiras/laboral-kutxa.js
- Owner: AndreMiras
- License: mit
- Created: 2023-09-02T19:20:45.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-20T18:31:43.000Z (12 months ago)
- Last Synced: 2024-09-07T22:48:21.289Z (27 days ago)
- Topics: banco, bank, kutxa, laboral
- Language: TypeScript
- Homepage: https://andremiras.github.io/laboral-kutxa.js
- Size: 695 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laboral-kutxa.js
[![Tests](https://github.com/AndreMiras/laboral-kutxa.js/workflows/Tests/badge.svg)](https://github.com/AndreMiras/laboral-kutxa.js/actions/workflows/tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/AndreMiras/laboral-kutxa.js/badge.svg?branch=main)](https://coveralls.io/github/AndreMiras/laboral-kutxa.js?branch=main)
[![Documentation](https://github.com/AndreMiras/laboral-kutxa.js/workflows/Documentation/badge.svg)](https://github.com/AndreMiras/laboral-kutxa.js/actions/workflows/documentation.yml)
[![npm version](https://badge.fury.io/js/laboral-kutxa.svg)](https://badge.fury.io/js/laboral-kutxa)Unofficial Laboral Kutxa JS library
## Install
```sh
npm install laboral-kutxa
```## Library Usage
Reading through the `misProductos` list:
```js
import { login, getMyProducts } from "laboral-kutxa";const main = async () => {
const { USERNAME, PASSWORD } = process.env;
const { token } = await login(USERNAME, PASSWORD);
const products = await getMyProducts(token);
products.misProductos.map(({ alias, grupo }) => ({ alias, grupo }));
};
```Output:
```js
[
{ alias: "CUENTA 0,0", grupo: "cuentasCorrientes" },
{ alias: "VISA ELECTRÓN", grupo: "tarjetas" },
{ alias: "PRESTAMO", grupo: "prestamos" },
];
```Accessing the aggregated amounts per account types:
```js
const products = await getMyProducts(token);
const { _CuentasCorrientes: currentAccount, _Financiacion: financing } =
products._Importes;
console.log({ currentAccount, financing });
```Output:
```js
{
currentAccount: { cantidad: 1234.56, moneda: 'EUR' },
financing: { cantidad: 123456.78, moneda: 'EUR' }
}
```## CLI Usage
It's also possible to consume the CLI directly to access the account.
```sh
npx laboral-kutxa --balance
```