Security update to Drupal 8.4.6
[yaffs-website] / node_modules / fork-stream / example.js
1 #!/usr/bin/env node
2
3 var ForkStream = require("./");
4
5 var fork = new ForkStream({
6   classifier: function classify(e, done) {
7     return done(null, e >= 5);
8   },
9 });
10
11 fork.a.on("data", console.log.bind(null, "a"));
12 fork.b.on("data", console.log.bind(null, "b"));
13
14 for (var i=0;i<20;++i) {
15   fork.write(Math.round(Math.random() * 10));
16 }