0.3.0 ā€¢ Published 8 months ago

@jones.tristand/hledger-parser v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Welcome to hledger-parser šŸ‘‹

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

0.3.0

8 months ago

0.2.2

2 years ago

0.2.0

2 years ago