tranquil-stream
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Tranquil Stream

Stream utilities to make quick results a little easier.

Installation

npm install --save tranquil-stream

Getting Started

Just require the module, every method lives at the top level.

Methods

bufferToStream(buffer)

Take a buffer object and make it into a Duplex stream.

const stream = bufferToStream(await fs.readFile('some/path/here.txt'));

jsonStreamToObject(stream)

Takes a stream object that contains stringified JSON data and parses it into an object (async).

const obj = await jsonStreamToObject(fs.createReadStream('my-json-file.json'));

// obj is just the exact, parsed json as an object

Readme

Keywords

Package Sidebar

Install

npm i tranquil-stream

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

201 kB

Total Files

21

Last publish

Collaborators

  • tewen