mirror of
https://github.com/voson-wang/toon.git
synced 2026-01-29 15:24:10 +08:00
feat(cli): memory-efficient streaming for encoding
This commit is contained in:
13
README.md
13
README.md
@@ -764,6 +764,19 @@ console.log(encode(data))
|
||||
// 2,Bob,user
|
||||
```
|
||||
|
||||
**Streaming large datasets:**
|
||||
|
||||
```ts
|
||||
import { encodeLines } from '@toon-format/toon'
|
||||
|
||||
const largeData = await fetchThousandsOfRecords()
|
||||
|
||||
// Memory-efficient streaming for large data
|
||||
for (const line of encodeLines(largeData)) {
|
||||
process.stdout.write(`${line}\n`)
|
||||
}
|
||||
```
|
||||
|
||||
## Playgrounds
|
||||
|
||||
Experiment with TOON format interactively using these community-built tools for token comparison, format conversion, and validation:
|
||||
|
||||
Reference in New Issue
Block a user