Socket
Socket
Sign inDemoInstall

nationwide

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nationwide

A Nationwide transactions table parser.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Nationwide

A Nationwide transactions table parser.

Review Version Downloads Quality Coverage

Installing

npm install nationwide

Documentation

Documentation and more detailed examples are hosted on Github Pages.

Usage

Copy the Nationwide statement table from the browser:

nationwide.html

<table>
  <tbody>
    <tr>
      <td>
        01 May 2023
        <div style="display: none">- 1</div>
      </td>
      <td>Visa purchase</td>
      <td>UBER *TRIP HELP.UBER.COM GB</td>
      <td class="currency">£5.00</td>
      <td class="currency"></td>
      <td class="amountCell currency">£55.00</td>
    </tr>
    <tr>
      <td>
        02 May 2023
        <div style="display: none">- 2</div>
      </td>
      <td>Visa purchase</td>
      <td>UBER *TRIP HELP.UBER.COM GB</td>
      <td class="currency">£5.00</td>
      <td class="currency"></td>
      <td class="amountCell currency">£50.00</td>
    </tr>
    <tr>
      <td>
        03 May 2023
        <div style="display: none">- 3</div>
      </td>
      <td>Visa purchase</td>
      <td>UBER *TRIP HELP.UBER.COM FR</td>
      <td class="currency">£20.00</td>
      <td class="currency"></td>
      <td class="amountCell currency">£30.00</td>
    </tr>
  </tbody>
</table>

Parse the table:

import fs from "fs";
import path from "path";
import { Transaction } from "./Transaction";

const transactions = Transaction.table(
  fs.readFileSync(path.join(__dirname, "nationwide.html"), "utf8"),
);
[
  {
    "date": "2023-01-01",
    "type": "Visa purchase",
    "account": "UBER *TRIP HELP.UBER.COM GB",
    "change": -5,
    "balance": 55
  },
  {
    "date": "2023-01-02",
    "type": "Visa purchase",
    "account": "UBER *TRIP HELP.UBER.COM GB",
    "change": -5,
    "balance": 50
  },
  {
    "date": "2023-01-03",
    "type": "Visa purchase",
    "account": "UBER *TRIP HELP.UBER.COM FR",
    "change": -20,
    "balance": 30
  }
]

Collate the transactions:

Transaction.collate(transactions);
{
  "UBER *TRIP HELP.UBER.COM FR": -20,
  "UBER *TRIP HELP.UBER.COM GB": -10
}

Tooling

Tests

To run tests:

npm run test

Documentation

To generate the documentation locally:

npm run docs

Linters

To run linters:

npm run lint

Formatters

To run formatters:

npm run format

Contributing

Please read this repository's Code of Conduct which outlines our collaboration standards and the Changelog for details on breaking changes that have been made.

This repository adheres to semantic versioning standards. For more information on semantic versioning visit SemVer.

Bump2version is used to version and tag changes. For example:

bump2version patch

Contributors

Remarks

Lots of love to the open source community!

Be kind to your mind Love each other It's ok to have a bad day

Keywords

FAQs

Package last updated on 05 Feb 2024

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