0.2.0 • Published 6 years ago

@lorenzofox3/for-await-node v0.2.0

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

CircleCI

for-await-node

Turn various nodejs data structures into asynIterators

Installation

npm install @lorenzofox3/for-await-node

Usage

  1. Readable stream
import {fromReadable} from '@lorenzofox3/for-await-node';
import fs from 'fs';

const readable = fs.createReadStream('path/To/File');

(async function(){
  for await (const chunk of fromReadable(readable)){
     console.log(chunk;
  }
})();