Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floatdrop/save-stream
Save stream contents and pipe it again later
https://github.com/floatdrop/save-stream
Last synced: 2 months ago
JSON representation
Save stream contents and pipe it again later
- Host: GitHub
- URL: https://github.com/floatdrop/save-stream
- Owner: floatdrop
- Created: 2014-09-02T13:42:54.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-07T18:37:49.000Z (over 9 years ago)
- Last Synced: 2024-10-14T06:29:35.253Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 152 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# save-stream
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]
Save stream contents and pipe it again later.
## Usage
```js
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
[npm-url]: https://npmjs.org/package/save-stream
[npm-image]: http://img.shields.io/npm/v/save-stream.svg?style=flat[travis-url]: http://travis-ci.org/floatdrop/save-stream
[travis-image]: http://img.shields.io/travis/floatdrop/save-stream.svg?branch=master&style=flat[depstat-url]: https://david-dm.org/floatdrop/save-stream
[depstat-image]: http://img.shields.io/david/floatdrop/save-stream.svg?style=flat