function decodeFromLines(lines: Iterable<string>, options?: DecodeOptions): JsonValue
Decodes TOON format from pre-split lines into a JavaScript value.This is a convenience wrapper around the streaming decoder that builds the full value in memory. Useful when you already have lines as an array or iterable and want the standard decode behavior with path expansion support.
Enable path expansion to reconstruct dotted keys into nested objects. When set to 'safe', keys containing dots are expanded into nested structures if all segments are valid identifiers (e.g., data.metadata.items becomes nested objects). Pairs with keyFolding='safe' for lossless round-trips.
When you already have lines from another source (file streams, network, etc.), decodeFromLines is more efficient than joining and splitting:
import { decodeFromLines } from 'toon';// Already have lines from somewhereconst lines = fetchLinesFromSource();// More efficient than:// const toonString = lines.join('\n');// const result = decode(toonString);const result = decodeFromLines(lines);