textLineStream
Source: lib/textLineStream.js (pure JS, portable)
Deno's TextLineStream (@std/streams) as a WHATWG TransformStream. Results match
jsr:@std/streams on every case in tests/unittests/test-textlinestream.js, which also
runs on node, bun and deno. Needs the TransformStream global (under qjsm, `import
'globals'` first).
| Class | Writable | Readable | Behavior |
|---|---|---|---|
TextLineStream({ allowCR = false }) | string | string | one chunk per line, without its terminator |
- lines end at
\nor\r\n; withallowCRa lone\rends a line too - the lines are the same however the text is split into chunks, including a
\r\ncut in two - a last line without a terminator is emitted when the stream ends; a trailing newline adds no empty line
bytes.pipeThrough(new TextDecoderStream())
.pipeThrough(new TextLineStream())
.pipeThrough(new JsonParseStream()); // newline-delimited JSONExport list
Generated by utilities/doc-api.js from the textLineStream dump of utilities/api-surface.sh: 2 members. Edit the text above this block, not the block.
TextLineStream
class, constructible