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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@frihet/aeb43-parser

v0.1.0

Published

AEB43 (Norma 43) Spanish bank statement parser for TypeScript. Supports BBVA, Santander, Sabadell, CaixaBank, Bankinter, and all AEB-standard N43 files.

Readme

@frihet/aeb43-parser

TypeScript parser for AEB43 (Norma 43) Spanish bank statement files (.N43 / .n43).

Supports BBVA, Santander, Sabadell, CaixaBank, Bankinter, and any bank that follows the AEB standard.

License: Apache-2.0


Installation

npm install @frihet/aeb43-parser
# or
pnpm add @frihet/aeb43-parser

Usage

import { parseAEB43 } from '@frihet/aeb43-parser';
import { readFileSync } from 'node:fs';

// AEB43 files use ISO-8859-1 (latin1) encoding
const content = readFileSync('statement.n43', 'latin1');
const statement = parseAEB43(content);

console.log(`Accounts: ${statement.accountCount}`);

for (const account of statement.accounts) {
  console.log(`Account: ${account.accountId}`);
  console.log(`Opening: ${account.openingBalance} EUR`);
  console.log(`Closing: ${account.closingBalance} EUR`);

  for (const tx of account.transactions) {
    console.log(`${tx.operationDate} ${tx.amount} — ${tx.description}`);
  }
}

Browser (File input)

import { parseAEB43, isAEB43 } from '@frihet/aeb43-parser';

async function handleFile(file: File) {
  // Detect format
  const firstBytes = await file.slice(0, 120).text();
  if (!isAEB43(firstBytes, file.name)) {
    throw new Error('Not an AEB43 file');
  }

  // Read as latin1 (AEB43 encoding)
  const buffer = await file.arrayBuffer();
  const content = new TextDecoder('iso-8859-1').decode(buffer);

  return parseAEB43(content);
}

API

parseAEB43(content: string): AEB43Statement

Parse an AEB43 file content string. Both LF and CRLF line endings are supported.

Throws AEB43ParseError on structural violations (bad sign chars, wrong record count, unknown record types, etc.).

isAEB43(content: string, fileName?: string): boolean

Detect whether content (or a filename) is likely AEB43 format. Checks .n43 / .N43 extension and/or the record-11 content signature.


Types

interface AEB43Statement {
  accountCount: number;
  totalRecords: number;
  accounts: AEB43Account[];
}

interface AEB43Account {
  entityCode: string;     // e.g. '0049' (Santander), '0182' (BBVA)
  branchCode: string;     // 4-digit branch
  accountNumber: string;  // 10-digit account
  accountId: string;      // '{entity}-{branch}-{account}'
  startDate: string;      // ISO 8601 YYYY-MM-DD
  endDate: string;        // ISO 8601 YYYY-MM-DD
  openingBalance: number; // Positive = credit, Negative = debit
  closingBalance: number;
  totalDebits: number;
  totalCredits: number;
  debitCount: number;
  creditCount: number;
  transactions: AEB43Transaction[];
}

interface AEB43Transaction {
  operationDate: string;       // ISO 8601 YYYY-MM-DD
  valueDate: string;           // ISO 8601 YYYY-MM-DD (fecha valor)
  amount: number;              // Positive = credit, Negative = debit
  conceptCode: string;         // 2-digit AEB concept code
  description: string;         // Primary description (from reference fields)
  additionalDescription: string; // From record 23/24 extension lines
  reference1: string;          // Document number field
  reference2: string;          // Secondary reference
  rawLine: string;             // Original 80-char record 22 line
}

AEB43 Format Reference

AEB43 (Norma 43) is a fixed-width, 80-character per line ASCII format published by the Asociación Española de Banca (AEB).

Record types:

  • 11: Account header (entity, branch, account, dates, opening balance)
  • 22: Transaction (dates, concept code, amount, references)
  • 23/24: Additional concept text extending the previous transaction
  • 33: Account footer (totals, closing balance)
  • 88: File footer (account count, total record count)

Amount encoding: sign char (1 = positive, 2 = negative) followed by digits with 2 implicit decimal places. Date encoding: YYMMDD — year < 50 maps to 20xx, year >= 50 maps to 19xx.

Official spec: AEB Norma 43


Publishing

This package is publish-ready. To publish to npm when approved:

cd packages/aeb43-parser
npm run build       # Compile TypeScript to dist/
npm publish --access public

Ensure dist/ is built and clean before publishing. The prepublishOnly script runs build automatically.


License

Apache-2.0 — see LICENSE.

Built by Frihet — AI-native ERP for freelancers and SMEs.