Skip to content

Volafile/writeable-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

writeable-buffer

A Writeable that buffers all data it receives up to maxBufferSize (default 10 MB).

If .toString([[encoding,] callback]) or toBuffer([callback]) are called with a callback, they become asynchronous and wait until the stream has been ended with stream.end() or an error occured. Without a callback they return all data buffered at that time.

Usage:

const WritableBuffer = require('writeable-buffer');

const buffer = new WritableBuffer({
    maxBufferSize: 5000, // Only buffer up to 5kb
});

stream.pipe(buffer, { end : true });

buffer.toString('utf8', (error, string) => {
    console.log(string);
});

About

A Writeable that buffers all data it receives.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published