Noticeably Playful Monkeys

    pta-tools
    TypeScript icon, indicating that this package has built-in type declarations

    1.5.1 • Public • Published

    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

    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-journal';
    
    function parse(stream: ReadableStream): 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

    Keywords

    none

    Install

    npm i pta-tools

    DownloadsWeekly Downloads

    1

    Version

    1.5.1

    License

    MIT

    Unpacked Size

    57.9 kB

    Total Files

    25

    Last publish

    Collaborators

    • kajyr