{"id":30956091,"url":"https://github.com/Fabiopf02/ofx-data-extractor","last_synced_at":"2025-09-11T12:07:10.507Z","repository":{"id":114873162,"uuid":"593024431","full_name":"Fabiopf02/ofx-data-extractor","owner":"Fabiopf02","description":"A module written in TypeScript that provides a utility to extract data from an OFX file in Node.js and Browser","archived":false,"fork":false,"pushed_at":"2025-06-03T18:24:48.000Z","size":315,"stargazers_count":18,"open_issues_count":0,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T22:56:58.772Z","etag":null,"topics":["banking","data-extraction","financial","no-dependencies","ofx","ofx-js","ofx-json","ofx-parser","open-financial-exchange","parser","qfx"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ofx-data-extractor","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fabiopf02.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-25T03:20:31.000Z","updated_at":"2025-06-03T18:24:32.000Z","dependencies_parsed_at":"2023-04-10T17:02:59.414Z","dependency_job_id":"0baeca54-1176-40b2-b2af-ee0c3d74502d","html_url":"https://github.com/Fabiopf02/ofx-data-extractor","commit_stats":null,"previous_names":["fabiopf02/ofx-ts"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/Fabiopf02/ofx-data-extractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabiopf02%2Fofx-data-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabiopf02%2Fofx-data-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabiopf02%2Fofx-data-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabiopf02%2Fofx-data-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fabiopf02","download_url":"https://codeload.github.com/Fabiopf02/ofx-data-extractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabiopf02%2Fofx-data-extractor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274632631,"owners_count":25321251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["banking","data-extraction","financial","no-dependencies","ofx","ofx-js","ofx-json","ofx-parser","open-financial-exchange","parser","qfx"],"created_at":"2025-09-11T12:03:56.452Z","updated_at":"2025-09-11T12:07:10.499Z","avatar_url":"https://github.com/Fabiopf02.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# [ofx-data-extractor](https://www.npmjs.com/package/ofx-data-extractor)\n\n[![npm version](https://badge.fury.io/js/ofx-data-extractor.svg)](https://badge.fury.io/js/ofx-data-extractor) [![MIT License][license-image]][license-url]\n[![codecov](https://codecov.io/gh/Fabiopf02/ofx-data-extractor/branch/main/graph/badge.svg?token=L4A7E4H8IN)](https://codecov.io/gh/Fabiopf02/ofx-data-extractor)\n[![Release Package](https://github.com/Fabiopf02/ofx-data-extractor/actions/workflows/release.yml/badge.svg)](https://github.com/Fabiopf02/ofx-data-extractor/actions/workflows/release.yml)\n\n## Ofx Data Extractor and Formatter\nThis is a `Node.js` and `Browser` module written in `TypeScript` that provides a utility for extracting data from an `OFX` file. The module can also format some of the data and retrieve specific parts of the file if requested.\n\n### Installation\nYou can install this module using the Node Package Manager (`NPM`) with the following command:\n\n**npm**\n```bash\nnpm install ofx-data-extractor\n```\n**yarn**\n```bash\nyarn add ofx-data-extractor\n```\n\n### Methods\nThe `Ofx` class provides the following methods:\n\n- `getType(): Types`: Used to get type of transactions from ofx (BANK or CREDIT_CARD)\n- `fromBuffer(data: Buffer)`: Used to read files on the node. Returns the methods\n- `fromBlob(data: Blob)`: Used to read files in the browser. Returns the methods below.\n- `config(options: OfxConfig)`: Used for formatting the generated json.`\n- `getHeaders(): OFXMetaData`: Returns the metadata section of the OFX file as an object.\n- `getBankTransferList(): Pick\u003cBankTransferList, 'STRTTRN'\u003e`: Returns a list of bank transfer transactions as an object.\n- `getCreditCardTransferList(): Pick\u003cBankTransferList, 'STRTTRN'\u003e`: Returns a list of credit card transactions as an object.\n- `getTransactionsSummary()`: Object: Returns a summary of transactions for a bank statement as an object.\n- `getContent(): OfxStructure`: Returns the OFX file content as an object.\n- `toJson(): OfxResponse`: Returns the entire OFX file content as a JSON object.\n\n### Usage\nThe module provides a class called Ofx that can be used to extract and format data from an `OFX` file. Here's an example of how to use it:\n\n```typescript\nimport { Ofx } from 'ofx-data-extractor'\n\nconst data = 'OFXHEADER:100\\nDATA:OFXSGML\\nVERSION:102\\n...'\nconst ofx = new Ofx(data) // works in node.js and browser\n\nconst headers = ofx.getHeaders()\nconsole.log(headers)\n\nconst transactionsSummary = ofx.getTransactionsSummary()\nconsole.log(transactionsSummary)\n\nconst bankTransferList = ofx.getBankTransferList()\nconsole.log(bankTransferList)\n\nconst ofxResponse = ofx.toJson()\nconsole.log(ofxResponse)\n```\n### Constructor\nThe `Ofx` class constructor takes in two arguments:\n\n`data`: The `OFX` file content as a string or a Buffer.\n`config`: Optional configuration options for formatting the OFX data.\n\n### Read data - static methods (`Node.js`)\n```typescript\nimport { Ofx } from 'ofx-data-extractor'\nimport fs from 'fs'\n\nconst file = await fs.readFile('/path/to/file')\nconst ofx = await Ofx.fromBuffer(file)\n\nconst ofxResponse = ofx.toJson()\nconsole.log(ofxResponse)\n```\n\n### Read data - static methods (`Browser`)\n```typescript\nimport { Ofx } from 'ofx-data-extractor'\n\nfunction handleFile(event) {\n    const ofx = Ofx.fromBlob(event.target.files[0])\n    const ofxResponse = ofx.toJson()\n    console.log(ofxResponse)\n}\n\n// tsx/jsx/html\n\u003cinput type=\"file\" onChange={handleFile} /\u003e\n```\n\n\n### Configuration\nThe `Ofx` (`constructor` and `config` method) class can be configured with the following options:\n\n- `formatDate`: A function that takes in a date string and returns a formatted date string.\n- `fitId`: A string that determines how the financial institution transaction ID is handled. Possible values are \"separated\" (the default) or \"included\".\n- `nativeTypes`: A boolean value that determines whether numeric fields should be represented as numbers or strings in the resulting JSON object.\n\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license-url]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFabiopf02%2Fofx-data-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFabiopf02%2Fofx-data-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFabiopf02%2Fofx-data-extractor/lists"}