Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jferrl/stream-to-buffer
A promise based npm package that converts a node.js ReadStream to buffer
https://github.com/jferrl/stream-to-buffer
js nodejs streaming typescript
Last synced: about 6 hours ago
JSON representation
A promise based npm package that converts a node.js ReadStream to buffer
- Host: GitHub
- URL: https://github.com/jferrl/stream-to-buffer
- Owner: jferrl
- License: mit
- Created: 2018-11-24T00:44:57.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T01:18:02.000Z (5 months ago)
- Last Synced: 2024-11-08T01:44:49.307Z (11 days ago)
- Topics: js, nodejs, streaming, typescript
- Language: TypeScript
- Size: 6.37 MB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stream To Buffer
[![Build Status](https://travis-ci.org/jferrl/stream-to-buffer.svg?branch=master)](https://travis-ci.org/jferrl/stream-to-buffer)
[![Maintainability](https://api.codeclimate.com/v1/badges/71b14075a12d34b2efbc/maintainability)](https://codeclimate.com/github/jferrl/stream-to-buffer/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/71b14075a12d34b2efbc/test_coverage)](https://codeclimate.com/github/jferrl/stream-to-buffer/test_coverage)
![npm](https://img.shields.io/npm/dw/@jorgeferrero/stream-to-buffer)
![npm (scoped)](https://img.shields.io/npm/v/@jorgeferrero/stream-to-buffer)A promise based Node.js package that converts a Node.js Readable to buffer
## Installation
```sh
npm i @jorgeferrero/stream-to-buffer
```## Usage
```typescript
import { streamToBuffer } from '@jorgeferrero/stream-to-buffer';
import * as fs from 'fs';const data = await streamToBuffer(fs.createReadStream('./file'));
console.log(data.toString());
``````sh
Output should be the the content of the file
```## Test
```sh
npm run test
```