UNPKG

239 BJavaScriptView Raw
1"use strict";
2
3const PassThrough = require('stream').PassThrough;
4
5module.exports = function(data, end) {
6 if(end === undefined)
7 end = true;
8
9 var tmp = new PassThrough();
10 tmp.write(data);
11 if(end)
12 tmp.end();
13 return tmp;
14};