1.6.0 • Published 3 years ago

pta-tools v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Plain text acounting node js api

Build Status

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

Main APIs

formatTransaction

import { formatTransaction } from 'pta-journal';
function formatTransaction(trx: Transaction): string

Returns the Transaction formatted in a way suitable to be appendend to a journal file

parse

import { parse } from 'pta-tools';
function parse(stream: ReadableStream): Promise<ParseResult>
type 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

const stream = fs.createReadStream('./hledger.journal');
1.6.0

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago