@extensionengine/hub3
v1.0.0
Published
Parse HUB3 formatted bank reports
Downloads
6
Keywords
Readme
@extensionengine/hub3
Parse HUB3 formatted bank reports
Installation
npm install @extensionengine/hub3
API
Table of Contents
HUB3Error
Extends Error
Base class for all HUB3 specific errors
isHUB3Error
Check if error is HUB3 specific error
Parameters
err
Error error
Returns boolean result
ParserError
Extends HUB3Error
Custom error class used for reporting parsing errors
parseHUB3
- **See: http://com.pbz.hr/download/Format_za_dostavu_izvadaka_klijentima_na_elektronskom_mediju.pdf **
Parse HUB3 bank report
Parameters
buffer
Buffer HUB3 file contents
Examples
const { HUB3Error, parse } = require('@extensionengine/hub3');
const path = require('path');
const { readFileSync } = require('fs');
const hub3 = readFileSync(path.join(__dirname, '../reports/1110779471-20200826.mn'));
try {
const records = parse(hub3);
console.log({ records });
} catch (err) {
if (!HUB3Error.isHUB3Error(err)) throw err;
console.error('Failed to parse report:', err.message);
process.exit(1);
}
- Throws ParserError
Returns Array<LineRecord> array of line records
LineRecord
Type: Object
Properties
tip_sloga
String type