A parser for hledger journal files based on Chevrotain.
npm install hledger-parser
import { parseLedgerToCooked } from '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 (@jonestristand), Author
- Daryl G. Wright (@darylwright), Lead Maintainer
Contributions, issues and feature requests are welcome!
Feel free to check the
issues page. You can also take a
look at the contributing guide.
Please see the roadmap for project status and a list of features to be implemented.
This is a detached fork of the original
hledger-parser
, and is in active development.
Special thanks goes out to @jonestristand for all the initial work he put into this project!
Give a ⭐️ if this project helped you!
Copyright © 2022 Tristan Jones jones.tristand@gmail.com.
Copyright © 2024 Daryl G. Wright daryl@goldenpath.ca.
This project is MIT licensed.