tranquil-stream
Version:
Working with streams, keeping it simple.
34 lines (20 loc) • 698 B
Markdown
Stream utilities to make quick results a little easier.
```BASH
npm install --save tranquil-stream
```
Just require the module, every method lives at the top level.
Take a buffer object and make it into a Duplex stream.
```JavaScript
const stream = bufferToStream(await fs.readFile('some/path/here.txt'));
```
Takes a stream object that contains stringified JSON data and parses it into an object (async).
```JavaScript
const obj = await jsonStreamToObject(fs.createReadStream('my-json-file.json'));
// obj is just the exact, parsed json as an object
```