Socket
Socket
Sign inDemoInstall

banking

Package Overview
Dependencies
8
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.2 to 0.2.3

29

lib/banking.js

@@ -11,3 +11,3 @@ var parser = require('xml2json')

exports.version = '0.2.2';
exports.version = '0.2.3';

@@ -27,6 +27,20 @@ /**

var ofx = ofxData.split('<OFX>',2);
var headerString = ofx[0].split(/\r|\n/);
var bodyXML = ('<OFX>'+ofx[1]).replace(/>\s+</g, '><').replace(/\s+</g, '<').replace(/>\s+/g, '>').replace(/<([A-Z0-9_]*)+\.+([A-Z0-9_]*)>([^<]+)/g, '<\$1\$2>\$3' ).replace(/<(\w+?)>([^<]+)/g, '<\$1>\$2</\$1>');
var ofxRes = ofxData.split('<OFX>',2);
var ofx = '<OFX>' + ofxRes[1];
var headerString = ofxRes[0].split(/\r|\n/);
var bodyXML = ofx
.replace(/>\s+</g, '><')
.replace(/\s+</g, '<')
.replace(/>\s+/g, '>')
.replace(/<([A-Z0-9_]*)+\.+([A-Z0-9_]*)>([^<]+)/g, '<\$1\$2>\$3' )
.replace(/<(\w+?)>([^<]+)/g, '<\$1>\$2</\$1>');
var bodyJSON = {};
var header = {};
console.log(ofx);
try {
bodyJSON = JSON.parse(parser.toJson(ofx));
} catch(e) {
bodyJSON = JSON.parse(parser.toJson(bodyXML));
}

@@ -38,3 +52,3 @@ for(var attrs in headerString){

var body = (format === 'json') ? JSON.parse(parser.toJson(bodyXML)) : bodyXML;
var body = (format === 'json') ? bodyJSON : bodyXML;
cb(body, null);

@@ -141,4 +155,5 @@ };

if( res.headers['content-type'] === 'text/html' ) return cb(body,'Expected: application/ofx or plain/text, Received: '+res.headers['content-type'] );
parseOfxString(body, format, cb);
if( format == 'ofx' ) return cb(body,null);
parseOfxString(body, format, cb);
});
};
};
{
"name": "banking"
, "description": "The missing Bank API for getting you statement data"
, "version": "0.2.2"
, "author": "Christian Sullivan <cs@euforic.co>"
, "keywords": ["banking", "ofx", "financial", "bank", "quickbooks"]
, "private": false
, "homepage": "http://euforic.github.com/banking.js"
, "dependencies": {
"xml2json": ">=0.2.4"
, "request": ">=2.1.1"
}
, "devDependencies": {
"mocha": "*"
, "should": "*"
"name": "banking",
"description": "The missing Bank API for getting you statement data",
"version": "0.2.3",
"author": "Christian Sullivan <cs@euforic.co>",
"keywords": [
"banking",
"ofx",
"financial",
"bank",
"quickbooks"
],
"private": false,
"homepage": "http://euforic.github.com/banking.js",
"dependencies": {
"request": "~2.12.0",
"xml2json": "~0.3.2"
},
"devDependencies": {
"mocha": "*",
"should": "*"
},
"repository": {
"type": "git",
"url": "http://github.com/euforic/banking.js.git"
},
"main": "lib/banking.js",
"scripts": {
"prepublish": "npm prune",
"test": "make test"
},
"engines": {
"node": ">= 0.6.2"
}
, "repository": {
"type": "git"
, "url": "http://github.com/euforic/banking.js.git" }
, "main": "lib/banking.js"
, "scripts": {
"prepublish" : "npm prune",
"test": "make test"
}
, "engines": { "node": ">= 0.6.2" }
}
# [Banking.js](http://euforic.co/banking.js) [![Build Status](https://secure.travis-ci.org/euforic/banking.js.png)](http://travis-ci.org/euforic/banking.js)
## The Missing API for your bank.
## The Missing API for your bank.
* Retrieve all of your bank transactions similiar to how quickbooks does it.

@@ -13,3 +13,3 @@ * No need to depend on or pay for third party services

The banks crappy malformed version of XML that many finacial apps such as quickbooks and quicken use to import your bank transactions from your bank acount, credit card, money market, etc..
The banks crappy malformed version of XML that many financial apps such as quickbooks and quicken use to import your bank transactions from your bank account, credit card, money market, etc..

@@ -20,3 +20,3 @@ ### The Long Version

* The file extension .ofx is associated with an Open Financial Exchange file as a standard format for the exchange of financial data between institutions.
* The file extension .ofx is associated with an Open Financial Exchange file as a standard format for the exchange of financial data between institutions.
* This file is universally accepted by financial software, including Intuit Quicken, Microsoft Money and GnuCash.

@@ -26,8 +26,8 @@

* The Open Financial Exchange file format was created in 1997 via a joint venture by CheckFree, Intuit and Microsoft.
* The purpose was to allow for a universally accepted financial format used to broker transactions on the Internet.
* The Open Financial Exchange file format was created in 1997 via a joint venture by CheckFree, Intuit and Microsoft.
* The purpose was to allow for a universally accepted financial format used to broker transactions on the Internet.
* The .ofx file format is seen when dealing with financial transactions involving consumers, businesses, stocks and mutual funds.
* [OFX on Wikipedia](http://en.wikipedia.org/wiki/Open_Financial_Exchange)
## Installation
## Installation

@@ -57,3 +57,3 @@ ```bash

, date_start: 20010125 /* Statement start date YYYYMMDDHHMMSS */
, date_end: 20110125 /* Statement end date YYYYMMDDHHMMSS */
, date_end: 20110125 /* Statement end date YYYYMMDDHHMMSS */
};

@@ -65,7 +65,7 @@

if(err) console.log(err)
console.log(res);
console.log(res);
});
```
### Parse file (Ofx|Qfx)
### Parse file (Ofx|Qfx)
Download file for quickbooks import from your bank and parse

@@ -76,3 +76,3 @@

if(err) done(err)
console.log(res);
console.log(res);
});

@@ -86,3 +86,3 @@ ```

if(err) done(err)
console.log(res);
console.log(res);
});

@@ -181,3 +181,3 @@ ```

## TODO
## TODO
* Retrieve users available accounts with out account numbers

@@ -190,3 +190,3 @@ * Add directory of common banks

## License
## License

@@ -193,0 +193,0 @@ (The MIT License)

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