# pta-journal

> Plain text accounting journal JS apis

Latest version **1.1.3** (published 2021-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install pta-journal
pnpm add pta-journal
yarn add pta-journal
bun add pta-journal
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2021-12-06 |
| First published | 2021-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 30.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Carlo 'kajyr' |
| Maintainers | kajyr |

## Links

- npm: https://www.npmjs.com/package/pta-journal
- Repository: https://github.com/kajyr/pta-journal
- Homepage: https://github.com/kajyr/pta-journal#readme
- Issues: https://github.com/kajyr/pta-journal/issues
- npm.io page: https://npm.io/package/pta-journal

## Dependencies (1)

- [split2](https://npm.io/package/split2.md) ^4.1.0

## Recent versions

- 1.1.3 (latest) — 2021-12-06
- 1.1.2 — 2021-12-03
- 1.1.1 — 2021-11-25
- 1.1.0 — 2021-11-25
- 1.0.0 — 2021-11-25
- 0.5.2 — 2021-11-20
- 0.5.1 — 2021-11-14
- 0.5.0 — 2021-11-10
- 0.4.0 — 2021-11-08
- 0.3.1 — 2021-11-06
- 0.3.0 — 2021-11-06
- 0.2.1 — 2021-11-06

## README

# PTA Journals node js api

[![Build Status](https://app.travis-ci.com/kajyr/pta-journal.svg?branch=main)](https://app.travis-ci.com/kajyr/pta-journal)

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](src/types.ts) 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

---
_Source: https://npm.io/package/pta-journal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
