newline-async-iterator
    Preparing search index...

    Function default

    • Create a newline iterator recognizing CR, LF, and CRLF using the Symbol.asyncIterator interface

      Parameters

      • source:
            | AsyncIterable<Uint8Array<ArrayBufferLike>, any, any>
            | AsyncIterator<Uint8Array<ArrayBufferLike>, any, any>

        The async iterable of Uint8Array chunks to iterate through

        import newlineIterator from "newline-async-iterator";

        const iterator = newlineIterator(readableStream);
        const results = [];
        for await (const line of iterator) results.push(line);
        console.log(results); // ["some", "string", "combination"];

      Returns AsyncIterableIterator<string>