compressText()
Compress a multiline string of log data
Compress a multiline string of log data. This is a convenience wrapper around compress() that splits the text on newlines.
Signature
Parameters
text
- Type:
string - Required: Yes
Multiline string containing log data. Will be split on \n characters.
Empty lines are automatically filtered out.
options
- Type:
CompressOptions - Required: No
Same options as compress().
Return Value
Returns a CompressionResult object, same as compress().
Examples
Basic Usage
Reading from File
Piping from Stream
With Progress Tracking
Processing Template Results
Implementation Details
compressText() is equivalent to:
When to Use
Use compressText() when:
- Reading log files directly as strings
- Processing multiline log data from APIs or databases
- Working with concatenated log output
Use compress() when:
- You already have an array of lines
- You need fine-grained control over line filtering
- Processing streaming data incrementally
See Also
- compress() - Compress an array of lines
- createDrain() - Incremental processing
- Types Reference - TypeScript interfaces