feat: encodeLines for streaming encoding to TOON

This commit is contained in:
Johann Schopplich
2025-11-20 18:37:46 +01:00
parent 660ed21e01
commit 2e992aed74
7 changed files with 269 additions and 99 deletions

View File

@@ -102,6 +102,16 @@ cat data.json | toon -
cat data.toon | toon --decode
```
## Performance
### Streaming Encoding
JSON→TOON conversions use line-by-line encoding internally, which avoids holding the entire TOON document in memory. This makes the CLI efficient for large datasets without requiring additional configuration.
::: info Token Statistics
When using the `--stats` flag, the CLI builds the full TOON string once to compute accurate token counts. For maximum memory efficiency on very large files, omit `--stats`.
:::
## Options
| Option | Description |