@ekwo-ai/journal-report

中文文档
0.25.2发布于 2026/11/13MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 3285

Reads a journal report or a general ledger detail saved as CSV — date, journal number, account code, debit, credit — with the chart of accounts and the contacts exported beside it, into plain objects in TypeScript: amounts as decimal strings, and what doe

原始使用文档
文档目录3 节
  1. The files
  2. What it returns
  3. Sources

@ekwo-ai/journal-report

Reads a journal report, or a general ledger detail, saved as CSV — the report a cloud ledger prints of every journal it posted, one row per line with the number of its journal — into plain objects, in TypeScript, with no dependencies. Beside it, the chart of accounts and the contacts, which the same ledger exports as CSV directly.

import { readJournalReport } from '@ekwo-ai/journal-report';

const books = readJournalReport([report, chart, contacts], { dateOrder: 'dmy' });

books.entries;    // [{ number: '102', journal: 'Receivable Invoice', date: '2025-01-15', lines: […] }, …]
books.accounts;   // [{ code: '090', name: 'Business Bank Account', type: 'Bank' }, …]
books.violations; // a journal that does not balance

The files

The report (required). Such a service exports its reports as a spreadsheet, not as CSV: open it and save it as CSV. A report is laid out for a person, so:

  • the header is the first row that names a Date, an Account Code, a Debit and a Credit — the title rows above it are passed over;
  • a line is a row whose date cell holds a date; the rows that head a group, total it, or give an opening or closing balance are passed over;
  • lines are gathered into entries by their journal number (Journal ID, Journal Number, Journal #), which the report has to carry: add the column in the report's column picker before exporting it, with the account code. A report without it is refused by name — there would be no way to put its lines back into entries.

Optional columns: Source (kept as the journal of the entry), Account, Description, Narration, Reference, Contact.

  • A date written in digits — 03/04/2026 — is read in the order the caller names (dateOrder: 'dmy' | 'mdy' | 'ymd') and refused without one: the order follows the region of the organisation, and the file does not say it. A date in ISO or with its month in letters (3 Apr 2026) needs none.
  • An amount is read as a spreadsheet displays it. In a comma-separated file the decimal mark is a point and a comma only groups thousands, three digits at a time (1,234.50). In a file separated by a semicolon or a tab the decimal mark is the one mark the number carries, and thousands are grouped by a space only. A negative is a minus or brackets. Anything else is refused.

The chart of accounts (optional): *Code, *Name, *Type, the rest ignored. Codes are kept as text: 090 stays 090.

The contacts (optional): *ContactName, AccountNumber, EmailAddress, TaxNumber, CompanyNumber; the country only when it is written as a two-letter code.

What it returns

The shape declared in src/types.ts, which is, field for field, the shape every reader of an accounting export in this repository declares for itself. A report says no currency: it prints the organisation's and does not name it. Amounts are decimal strings, never negative. What does not add up comes back in violations; what is not a report is thrown as a BooksFileError with a code.

It knows no chart of accounts: in Ekwo OS the correspondence is made by ekwo import journal-report <files…> --date-order dmy.

Sources

This reader was written against the reports of Xero, read on 22 September 2026 from its help centre:

ekwo import xero <files…> is the same as ekwo import journal-report.

What those pages do not state — the exact text of the title and total rows — is why the reader finds the header by its columns and a line by its date, rather than by position. The fixtures under test/fixtures/ are written by hand from those pages and hold no real data.

MIT.

版本与发布记录

@ekwo-ai/journal-report 共发布 28 个版本,首次发布于 2026/09/22;过去 12 个月发布了 28 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.25.2latest2026/11/13今天
0.25.02026/11/076 天前
0.24.12026/11/059 天前
0.24.02026/10/2816 天前
0.23.02026/10/2816 天前
0.22.02026/10/2816 天前

关于 @ekwo-ai/journal-report 的常见问题

@ekwo-ai/journal-report 是什么?

Reads a journal report or a general ledger detail saved as CSV — date, journal number, account code, debit, credit — with the chart of accounts and the contacts exported beside it, into plain objects in TypeScript: amounts as decimal strings, and what doe

如何安装 @ekwo-ai/journal-report?

在项目目录运行 npm install @ekwo-ai/journal-report,或使用 pnpm add / yarn add / bun add。

@ekwo-ai/journal-report 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ekwo-ai/journal-report 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ekwo-ai/journal-report 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ekwo-ai/journal-report 可以商用吗?

@ekwo-ai/journal-report 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ekwo-ai/journal-report 的下载量有多少?

根据 npm 官方下载统计,@ekwo-ai/journal-report 在 2026/10/13 – 2026/11/11 这 30 天内被下载 3,285 次,日均约 110 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ekwo-ai/journal-report 还在维护吗?

最新版本 0.25.2 发布于 2026/11/13(今天);至今共发布 28 个版本,其中过去 12 个月发布了 28 个;首次发布于 2026/09/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。