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

3.0.7 • Public • Published

streamtoarray

streamtoarray converts streams to arrays.

Status

Category Status
Version npm
Dependencies David
Dev dependencies David
Build GitHub Actions
License GitHub

Installation

$ npm install streamtoarray

Quick start

First you need to integrate streamtoarray into your application:

const { toArray } = require('streamtoarray');

If you use TypeScript, use the following code instead:

import { toArray } from 'streamtoarray';

Then you can call toArray with a stream. The stream gets converted and its contents are returned as an array once the stream has ended:

const array = await toArray(stream);

If the stream emits an error event, an exception is thrown, and the partially parsed array is provided as the array property of the exception:

try {
  const array = await toArray(stream);
} catch (ex) {
  console.log(ex.array);

  // ...
}

Running quality assurance

To run quality assurance for this module use roboter:

$ npx roboter

Package Sidebar

Install

npm i streamtoarray

Weekly Downloads

15

Version

3.0.7

License

MIT

Unpacked Size

8.14 kB

Total Files

13

Last publish

Collaborators

  • thenativeweb-admin
  • goloroden