0.2.0 • Published 6 years ago
@lorenzofox3/for-await-node v0.2.0
for-await-node
Turn various nodejs data structures into asynIterators
Installation
npm install @lorenzofox3/for-await-node
Usage
- 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;
}
})();