Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 8, 2024 via pnpm

get-stream 2.0.0

Get a stream as a string or buffer
Package summary
Share
0
issues
1
license
3
MIT
Package created
14 Oct 2015
Version published
3 Mar 2016
Maintainers
2
Total deps
3
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
get-stream@2.0.0
pinkie-promise@2.0.1
pinkie@2.0.4
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of get-stream 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
pinkie-promise2.0.11.5 kBMIT
prod

Visualizations

Frequently Asked Questions

What does get-stream do?

The "get-stream" npm package is designed to convert streams into strings, buffers, array buffers, or arrays in the JavaScript environment. It's compatible with Node.js, browsers, and enables various stream types including text streams, binary streams, and object streams. The package also facilitates async iterables usage, allows assigning a maximum stream size, swiftly returns partially read data when an error occurs in the stream, and is quite efficient in terms of its performance.

How do you use get-stream?

To use "get-stream", you'll need to first install the package using npm by running npm install get-stream. Once installed, you can utilize it in your JavaScript code. It has various methods to get a readable stream and convert it to the respective format.

For instance, to read a Node.js Stream, you might use this code:

import fs from 'node:fs';
import getStream from 'get-stream';

const stream = fs.createReadStream('unicorn.txt');
console.log(await getStream(stream)); 

If your scenario involves reading a Web Stream, you would use this different approach:

import getStream from 'get-stream';

const {body: readableStream} = await fetch('https://example.com');
console.log(await getStream(readableStream));

For Async Iterables, it could be something like this:

import {opendir} from 'node:fs/promises';
import {getStreamAsArray} from 'get-stream';

const asyncIterable = await opendir(directory);
console.log(await getStreamAsArray(asyncIterable));

These are just a few of the many examples of using "get-stream" in various different scenarios.

Where are the get-stream docs?

The documentation for "get-stream" can be found in the README file in the official GitHub repository. The README contains a comprehensive guide on how to use this npm package, its methods, as well as error handling and other tips.