const readStreamAsString Target Style export const readStreamAsString = async ({ from, encoding = 'utf-8' }) => { Reads a stream into a string with named options. Target style API. Preferred for new code. Parametersoptions{ from: AsyncIterable<any>, encoding?: BufferEncoding } ReturnsPromise<string> Exampleconst text = await readStreamAsString({ from: stream, })
const streamToString Legacy Style export const streamToString = async (stream) => readStreamAsString({ from: stream }) Reads a stream into a UTF-8 string. Legacy API. Kept for older code and not the preferred choice for new code. ParametersstreamAsyncIterable<any> ReturnsPromise<string>