# get-stream **Repository Path**: mirrors_floatdrop/get-stream ## Basic Information - **Project Name**: get-stream - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-05-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) > Get a stream as a string or buffer ## Install ``` $ npm install --save get-stream ``` ## Usage ```js const fs = require('fs'); const getStream = require('get-stream'); const stream = fs.createReadStream('unicorn.txt'); getStream(stream).then(str => { console.log(str); /* ,,))))))));, __)))))))))))))), \|/ -\(((((''''((((((((. -*-==//////(('' . `)))))), /|\ ))| o ;-. '((((( ,(, ( `| / ) ;))))' ,_))^;(~ | | | ,))((((_ _____------~~~-. %,;(;(>';'~ o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ ; ''''```` `: `:::|\,__,%% );`'; ~ | _ ) / `:|`----' `-' ______/\/~ | / / /~;;.____/;;' / ___--,-( `;;;/ / // _;______;'------~~~~~ /;;/\ / // | | / ; \;;,\ (<_ | ; /',/-----' _> \_| ||_ //~;~~~~~~~~~ `\_| (,~~ \~\ ~~ */ }); ``` ## API Both methods returns a promise that is resolved when the `end` event fires on the stream, indicating that there is no more data to be read. ### getStream(stream) Get the stream as a string. ### getStream.buffer(stream) Get the stream as a buffer. ## FAQ ### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? This one accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string or buffer. It doesn't have a fragile type inference. You explicitly choose what you want. It supports back-pressure and it doesn't depend on the huge `readable-stream` package. ## Related - [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer ## License MIT © [Sindre Sorhus](http://sindresorhus.com)