The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
20 lines
495 B
JavaScript
20 lines
495 B
JavaScript
var common = require('../common.js');
|
|
var stream = require('stream');
|
|
var Buffer = require('buffer').Buffer;
|
|
|
|
var r = new stream.Readable();
|
|
r._read = function(size) {
|
|
r.push(new Buffer(size));
|
|
};
|
|
|
|
var w = new stream.Writable();
|
|
w._write = function(data, encoding, cb) {
|
|
cb(null);
|
|
};
|
|
|
|
r.pipe(w);
|
|
|
|
// This might sound unrealistic, but it happens in net.js. When
|
|
// `socket.allowHalfOpen === false`, EOF will cause `.destroySoon()` call which
|
|
// ends the writable side of net.Socket.
|
|
w.end();
|