@jones.tristand/hledger-parser
v0.3.0
Published
A parser for ledger/hledger journal files based on Chevrotain
Downloads
7
Readme
Welcome to hledger-parser 👋
A parser for ledger/hledger journal files based on Chevrotain
Grammar
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 [email protected]
- Website: https://www.tdjones.ca
- Twitter: @TDJonesEM
- Github: @jonestristand
🤝 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 [email protected]. This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator