Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pta-tools

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pta-tools

Plain text accounting journal JS apis

  • 1.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9K
increased by6696.55%
Maintainers
1
Weekly downloads
 
Created
Source

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');

FAQs

Package last updated on 07 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc