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

@hublaw/ofx-parser

v1.1.0

Published

A tool that converts financial data from OFX to JS Object.

Downloads

21

Readme

npm GitHub top language GitHub Release Date GitHub last commit GitHub

A light weight Typescript tool that converts financial data from OFX into JS Object, applied only to Bank Account Statement developed and mantained by HubLaw and @gusflopes, and originally written by @bakesaled.


🖋 Credits

This tools depends on the xml2js package and started by a fork from @bakesaled/carbonate that did an awesome work mapping all the Ofx Structure to interfaces.


🚧 Current Status

This tool is still under development and missing tests, but it works as intendend.

This package is currently being used on project under development.


📝 Instructions

There are two ways to use this use this package. You could use it as a dependency on your project to handle parsing OFX files. Or you can run it using the command line tool.

Using this package on your project

It's pretty straightforward, you just need to install this package and use the parseStatement() or parseStatementFile() functions from the OfxParser module.

Create a Class to handle Ofx Files

Basically you need to need to install the package:

yarn add @hublawbr/ofx-parser

After that you can create a class to Handle Ofx files:

import OfxParser from '@hublaw/ofx-parser'

export default class OfxHandler() {
  private ofxParser = new OfxParser()
  // Call this handler using a filePath from local file system
  // You could use this together with an upload route from Controller
  public async handler(filePath: string) {
    const result: StatementModel = await ofxParser.parseStatementFile(filePath)
    
    return result
  }
}

You don't really need a class just for that. Specially if using the parseStatementFile() instead of the parseStatement().

The reason I personally prefer using it is because I do more stuff with the Ofx File, like: upload to GCloud Storage, persisting the transactions to bank, formatting specific fields like dates, download Ofx from GCloud, create signedUrl to share file, create readable stream from Gcloud instead of file system, and a few other stuff.

Other use cases

Suggestions would be appreciated, but you can see the examples folder

Using as command line tool

You can run this project as originally designed using a command tool. For that you want to clone the repository, and run the following commands:

$ yarn install

$ yarn start

License

MIT © HubLAW