Socket
Socket
Sign inDemoInstall

nationwide

Package Overview
Dependencies
15
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nationwide

A Nationwide transactions table parser.


Version published
Weekly downloads
1
decreased by-99.94%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Nationwide

A Nationwide transactions table parser.

Status

SourceShields
Projectlatest_release license line_count language_count
Healthdocumentation review_action codacy_quality codacy_coverage
Publishersnpm_version npm_downloads
Repositoryopen_issues closed_issues open_pulls closed_pulls
Activitycontributors monthly_commits last_commit

Installation

npm i nationwide

Usage

Copy the Nationwide statement table from the browser:

nationwide.html

<table>
  <tbody>
    <tr>
      <td>
        01 May 2021
        <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 2021
        <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 2021
        <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.resolve(__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
}

Tests

To run tests:

nps test

Documentation

This repository's documentation is hosted on Read the Docs.

To generate the documentation locally:

quickdocs

Linters

To run linters:

nps lint

Formatters

To run formatters:

nps format

Continuous integration

This repository uses GitHub Actions to lint and test each commit. Each commit should be formatted and its corresponding documentation should be updated.

Versioning

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

Changelog

Please read this repository's changelog for details on changes that have been made.

Contributing

Please read this repository's guidelines on contributing for details on the process for submitting pull requests. Moreover, our code of conduct declares our collaboration standards.

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

FAQs

Last updated on 06 Mar 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc