Caution
This repository has been DEPRECATED. The project is still maintained at https://github.com/goldenpathtechnologies/hledger-parser.
A parser for ledger/hledger journal files based on Chevrotain
npm install @jones.tristand/hledger-parser
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: []
// => }
👤 Tristan Jones [email protected]
- Website: https://www.tdjones.ca
- Twitter: @TDJonesEM
- Github: @jonestristand
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a ⭐️ if this project helped you!
Copyright © 2022 Tristan Jones [email protected].
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator