buffer-file-stream

1.0.0 • Public • Published

buffer-file-stream

Write each buffer chunk to an individual file with an incrementing file name.

Useful for dumping an upstream stream to a series of files.

build status

Installation

This module is installed via npm:

$ npm install buffer-file-stream

Example Usage

Write all new Buffer data chunks to incrementing files:

var bufferFileStream = require('buffer-file-stream');
 
// writes all Buffer 'data' chunks to blah-000.txt, blah-001.txt, etc
// uses sprintf syntax for pattern
 
var bfs = bufferFileStream('/tmp/blah-%03d.txt');
 
bfs.write('hello');
// creates a text file /tmp/blah-000.txt with the text 'hello'
 
bfs.write('world');
// creates a text file /tmp/blah-001.txt with the text 'world'

/buffer-file-stream/

    Package Sidebar

    Install

    npm i buffer-file-stream

    Weekly Downloads

    3

    Version

    1.0.0

    License

    BSD-3-Clause

    Last publish

    Collaborators

    • eugeneware