Nondeterministic Polynomial Munchies

    newline-async-iterator
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.1 • Public • Published

    newline-async-iterator

    Line-by-line async iterator for the browser and node

    Example 1: Parse json line by line

    import newlineIterator from "newline-async-iterator";
    import "isomorphic-fetch";
    import responseIterator from "response-iterator";
    
    const res = await fetch("https://raw.githubusercontent.com/kmalakoff/newline-async-iterator/master/package.json");
    
    const lines = [];
    for await (const line of newlineIterator(responseIterator<Uint8Array>(res))) lines.push(line);
    console.log(JSON.parse(lines.join("\r\n")).name); // "newline-async-iterator"

    Documentation

    API Docs

    Install

    npm i newline-async-iterator

    DownloadsWeekly Downloads

    2

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    58.7 kB

    Total Files

    22

    Last publish

    Collaborators

    • kmalakoff