1 |
|
2 | var through = require('through2')
|
3 | , setImmediate = global.setImmediate
|
4 |
|
5 | setImmediate = setImmediate || function(func) {
|
6 | setTimeout(func, 0)
|
7 | }
|
8 |
|
9 | module.exports.testStream = function() {
|
10 | return through(function(buf, enc, cb) {
|
11 | var that = this;
|
12 | setImmediate(function() {
|
13 | that.push(buf)
|
14 | cb();
|
15 | });
|
16 | });
|
17 | };
|