aboutsummaryrefslogtreecommitdiff
path: root/node_modules/unique-stream/README.md
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-11-03 01:33:53 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-11-03 01:33:53 +0100
commitd1291f67551c58168af43698a359cb5ddfd266b0 (patch)
tree55a13ed29fe1915e3f42f1b1b7038dafa2e975a7 /node_modules/unique-stream/README.md
parentd0a0695fb5d34996850723f7d4b1b59c3df909c2 (diff)
downloadwallet-core-d1291f67551c58168af43698a359cb5ddfd266b0.tar.xz
node_modules
Diffstat (limited to 'node_modules/unique-stream/README.md')
-rw-r--r--node_modules/unique-stream/README.md50
1 files changed, 47 insertions, 3 deletions
diff --git a/node_modules/unique-stream/README.md b/node_modules/unique-stream/README.md
index f19b20a37..fce2ec019 100644
--- a/node_modules/unique-stream/README.md
+++ b/node_modules/unique-stream/README.md
@@ -2,11 +2,12 @@
node.js through stream that emits a unique stream of objects based on criteria
-[![build status](https://secure.travis-ci.org/eugeneware/unique-stream.png)](http://travis-ci.org/eugeneware/unique-stream)
+[![Build Status](https://travis-ci.org/eugeneware/unique-stream.svg?branch=master)](https://travis-ci.org/eugeneware/unique-stream)
+[![Coverage Status](https://coveralls.io/repos/eugeneware/unique-stream/badge.svg?branch=master&service=github)](https://coveralls.io/github/eugeneware/unique-stream?branch=master)
## Installation
-Install via npm:
+Install via [npm](https://www.npmjs.com/):
```
$ npm install unique-stream
@@ -28,7 +29,7 @@ function makeStreamOfObjects() {
for (var i = 0; i < 3; i++) {
setImmediate(function () {
s.emit('data', { name: 'Bob', number: 123 });
- --count && end();
+ --count || end();
});
}
@@ -87,3 +88,46 @@ makeStreamOfObjects()
aggregator.on('data', console.log);
```
+
+## Use a custom store to record keys that have been encountered
+
+By default a set is used to store keys encountered so far, in order to check new ones for
+uniqueness. You can supply your own store instead, providing it supports the add(key) and
+has(key) methods. This could allow you to use a persistant store so that already encountered
+objects are not re-streamed when node is reloaded.
+
+``` js
+var keyStore = {
+ store: {},
+
+ add: function(key) {
+ this.store[key] = true;
+ },
+
+ has: function(key) {
+ return this.store[key] !== undefined;
+ }
+};
+
+makeStreamOfObjects()
+ .pipe(unique('name', keyStore))
+ .on('data', console.log);
+```
+
+## Contributing
+
+unique-stream is an **OPEN Open Source Project**. This means that:
+
+> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
+
+See the [CONTRIBUTING.md](https://github.com/eugeneware/unique-stream/blob/master/CONTRIBUTING.md) file for more details.
+
+### Contributors
+
+unique-stream is only possible due to the excellent work of the following contributors:
+
+<table><tbody>
+<tr><th align="left">Eugene Ware</th><td><a href="https://github.com/eugeneware">GitHub/eugeneware</a></td></tr>
+<tr><th align="left">Craig Ambrose</th><td><a href="https://github.com/craigambrose">GitHub/craigambrose</a></td></tr>
+<tr><th align="left">Shinnosuke Watanabe</th><td><a href="https://github.com/shinnn">GitHub/shinnn</a></td></tr>
+</tbody></table>