Package Exports
- get-stream
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (get-stream) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
get-stream 
Get a stream as a string or buffer
Install
$ npm install --save get-stream
Usage
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.
Related
- get-stdin - Get stdin as a string or buffer
License
MIT © Sindre Sorhus