Parses a complete Beancount file string into a ParseResult containing Node objects.
This is the main entry point for parsing Beancount files. It handles:
The complete Beancount file content as a string
A ParseResult instance containing all parsed nodes
This is the primary function you'll use from this library. It takes a Beancount file as a string and returns a structured ParseResult object containing the resulting parsed nodes.
Basic usage:
import { parse } from 'beancount'const content = `2024-01-01 open Assets:Checking2024-01-02 * "Payee" "Narration" Assets:Checking 100.00 USD Income:Salary -100.00 USD`const result = parse(content)// result.nodes contains parsed Node objects Copy
import { parse } from 'beancount'const content = `2024-01-01 open Assets:Checking2024-01-02 * "Payee" "Narration" Assets:Checking 100.00 USD Income:Salary -100.00 USD`const result = parse(content)// result.nodes contains parsed Node objects
Parses a complete Beancount file string into a ParseResult containing Node objects.
This is the main entry point for parsing Beancount files. It handles: