1.1.3 • Published 4 years ago
pta-journal v1.1.3
PTA Journals node js api
Plain text accounting JS helpers to interact with the ledger / hledger journal file format.
On the TS / JS side Transactions are described by the Transaction type
Apis
formatTransaction
import { formatTransaction } from 'pta-journal';function formatTransaction(trx: Transaction): stringReturns the Transaction formatted in a way suitable to be appendend to a journal file
parse
import { parse } from 'pta-journal';function parse(stream: ReadableStream): ParseResulttype ParseResult = {
transactions: Transaction[];
accounts: string[];
commodities: string[];
};Returns the transactions, the accounts and the commodities from a journal. To get the stream of the journal you can use