Skip to content

holodex/save-stream

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

save-stream

NPM version Build Status Dependency Status

Save stream contents and pipe it again later.

Usage

var save = require('save-stream');

var saved = save();
saved.write(1);
saved.write(2);
saved.write(3);
saved.write(4);
saved.end();

saved.load().pipe(console.log);
setTimeout(function () {
    saved.load().pipe(console.log);
}, 1000);

/* Output:
1
2
3
4
1
2
3
4
*/

API

save()

Returns pass through stream with additional method

save.load()

Returns pass through stream, that will emit all data from the begining.

Note: it may change to 1.0.0 version, because initialy I wanted just overload pipe method.

License

MIT (c) 2014 Vsevolod Strukchinsky

About

Save stream contents and pipe it again later

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%