@jones.tristand/hledger-parser
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Welcome to hledger-parser 👋

Version Documentation Maintenance License: MIT Circle CI Twitter: TDJonesEM

hledger-parser logo

A parser for ledger/hledger journal files based on Chevrotain

Grammar

🏗️ Parsing diagram

Install as Library

npm install @jones.tristand/hledger-parser

Usage

import { parseLedgerToCooked } from '@jones.tristand/hledger-parser';

const parseResult = parseLedgerToCooked(sourceCode);

console.log(`Lexing errors: ${parseResult.lexErrors.length}`);
console.log(`Parsing errors: ${parseResult.parseErrors.length}`);
console.log('Result:', parseResult.cookedJournal);

// Output:
// => Lexing errors: 0
// => Parsing errors: 0
// => Result: {
// =>   transactions: [
// =>     {
// =>       date: [Object],
// =>       status: 'unmarked',
// =>       description: 'Transaction',
// =>       postings: [Array],
// =>       tags: []
// =>     }
// =>   ],
// =>   accounts: [],
// =>   prices: []
// => }

Author

👤 Tristan Jones jones.tristand@gmail.com

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2022 Tristan Jones jones.tristand@gmail.com.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

Readme

Keywords

none

Package Sidebar

Install

npm i @jones.tristand/hledger-parser

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

288 kB

Total Files

84

Last publish

Collaborators

  • jones.tristand