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

ofx4js

v2.1.0

Published

A javascript OFX library, ported from OFX4J

Downloads

486

Readme

Ofx4js

A pure javascript port of OFX4J- an OFX implementation. Works in node.js and in browsers (see security note below).

Note: There is no affiliation between the Ofx4j and Ofx4js projects.

Installation

Install with

  npm install ofx4js

Then

  import * as ofx4js from 'ofx4js';

Usage

To parse an OFX response:

  // aliases
  import { AggregateUnmarshaller, ResponseEnvelope } from 'ofx4js';

  // your ofx data
  var ofxData = "OFXHEADER:100...";

  // an unmarshaller that will read responses.  Note you will use a
  //  ResponseEnvelope to read responses, and a RequestEnvelope to read
  //  requests.
  var m = new AggregateUnmarshaller(ResponseEnvelope);

  // parse the string into the ofx data structures
  var data = m.unmarshal(ofxData);

  // read the data
  var messageSets = data.getMessageSets();
  var bankingResponse = messageSets[1].cast<BankingResponseMessageSet>().getStatementResponse();

To download a bank's profile information:

  // aliases
  import { BaseFinancialInstitutionData, OFXV1Connection } from 'ofx4js';

  // input your bank's information.  See http://www.ofxhome.com/
  var bank = new BaseFinancialInstitutionData();
  bank.setFinancialInstitutionId(...);
  bank.setOrganization(...);
  bank.setOFXURL(...);
  bank.setName(...);

  var connection = new OFXV1Connection();

  var service = new FinancialInstitutionImpl(bank, connection);
  return service.readProfile()
  .then(function(data) {
    // data successfully retrieved
    console.log(data);
  });

NOTE: making an OFX connection will fail security checks in browsers. On Chrome you can make it run with the "--disable-web-security" command-line option

e.g. (OSX): open /Applications/Google\ Chrome.app --args --disable-web-security

Status

Presently it can parse ofx strings, create ofx requests, and contact servers. Good enough to get started, but expect bugs.

Port

Ofx4js was ported from Ofx4j at r45 (1.7)

This project contains a lot of files that were ported from java to javascript by a combination of a perl script and a lot of hand editing. Because of syntax differences between the two languages, not everything ported especially cleanly. There are probably hidden bugs stemming from the port.

Because the code is a port, there are a lot of java-isms (e.g. property accessors) that don't make sense in javascript and could probably be simplified. There are no plans to address this.

This is not a full port of ofx4j- specifically, the server portion is gone, as are the FinancialInstitutionDataStore-related classes. That is, you will have to provide your own financial insitution

Contributing

Github push requests are welcome. Please create test cases. Bugs that are originally in Ofx4j should be contributed to that project.

License

Ofx4j was released under the Apache License V2.0. The license has been kept on files originally from that project, and where applicable the files remain under that license. Where not specified (i.e., the files created especially for the javascript port) the files are released under the MIT license.