import * as ez from 'ez-streams'
reader = ez.devices.string.reader(text, options)
creates an EZ reader that reads its chunks fromtext
.
reader.read(_)
will return the chunks asynchronously by default.
You can force synchronous delivery by settingoptions.sync
totrue
. The default chunk size is 1024. You can override it by passing achunkSize
option.writer = ez.devices.string.writer(options)
creates an EZ writer that collects strings into a text buffer.
writer.write(_, data)
will write asynchronously by default.
You can force synchronous write by settingoptions.sync
totrue
.writer.toString()
returns the internal text buffer into which the strings have been collected.