1.1.0 • Published 6 years ago

async-lines v1.1.0

Weekly downloads
13
License
MIT
Repository
github
Last release
6 years ago

Async Lines

Get an async iterator over lines in a stream.

Installation

npm install --save async-lines

Usage

const fs = require('fs')
const asyncLines = require('async-lines')

// Print current file to stdout
const stream = fs.createReadStream(__filename)

for await (const line of asyncLines(stream)) {
  console.log(line)
}

API

asyncLines(stream: Readable) => AsyncIterableIterator<string>

Returns a new async iterator that iterates over all the lines in the stream.