# ofx-js

> Parse OFX files using pure JavaScript.

Latest version **1.1.2** (published 2026-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install ofx-js
pnpm add ofx-js
yarn add ofx-js
bun add ofx-js
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2026-09-30 |
| First published | 2017-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 62 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34 |
| Maintainers | bradenmacdonald |
| Keywords | ofx, open financial exchange, bank, banking, export |

## Links

- npm: https://www.npmjs.com/package/ofx-js
- Repository: https://github.com/bradenmacdonald/ofx-js
- Issues: https://github.com/bradenmacdonald/ofx-js/issues
- npm.io page: https://npm.io/package/ofx-js

## Recent versions

- 1.1.2 (latest) — 2026-09-30
- 1.1.1 — 2026-05-20
- 1.1.0 — 2026-05-20
- 1.0.0 — 2026-05-13
- 0.2.0 — 2024-01-12
- 0.1.1 — 2017-08-28
- 0.1.0 — 2017-04-02

## README

# OFX JS

Parse Open Financial Exchange (OFX) files into a usable data structure. Also supports Quicken/QFX files.

✨ Now includes fairly comprehensive TypeScript types and documentation of the
various OLX data fields in the parsed data structure.

For details on the OFX file format, download the latest specification from
https://financialdataexchange.org/about-fdx/ofx-work-group/

[![NPM Version](https://img.shields.io/npm/v/ofx-js)](https://www.npmjs.com/package/ofx-js)
![NPM Downloads](https://img.shields.io/npm/dm/ofx-js)

# Goals

* Work in any JS environment (no dependencies at all)
* Have as small a footprint as possible
* Parse only, no serialization
* Full TypeScript types (opt-in using `parseStrict` instead of `parseSync`)

# History

This was originally based on [node-ofx](https://github.com/chilts/node-ofx), but has since been modified extensively.

# Usage

Installation:

```sh
npm install ofx-js
```

Example usage:

```typescript
import { parseStrict as parseOFX } from 'ofx-js';

const ofxString = readFile("bank-statement.ofx");

const ofxData = parseOFX(ofxString);

// Check that this file includes the expected response data:
if (!ofxData.OFX.BANKMSGSRSV1?.STMTTRNRS || Array.isArray(ofxData.OFX.BANKMSGSRSV1.STMTTRNRS)) {
    throw Error('Expected a single statement transaction response.');
}

const statementResponse = ofxData.OFX.BANKMSGSRSV1.STMTTRNRS.STMTRS;
if (!statementResponse) {
    throw Error('Missing statement response payload.');
}

const accountId = statementResponse.BANKACCTFROM.ACCTID;
const currencyCode = statementResponse.CURDEF;
// Bank account transactions: may be an array of transactions, a single transaction, or undefined.
const transactionStatement = statementResponse.BANKTRANLIST?.STMTTRN;
// do something...
```

---
_Source: https://npm.io/package/ofx-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
