Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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