innovationDriveApp/node_modules/memory-streams/lib/ReadableStream.js
2018-07-08 19:21:40 +10:00

32 lines
No EOL
674 B
JavaScript

//------------------------------------------------------------------
// Dependencies
var Stream = require('readable-stream')
, util = require('util');
//------------------------------------------------------------------
// Exports
module.exports = ReadableStream;
//------------------------------------------------------------------
// ReadableStream class
util.inherits(ReadableStream, Stream.Readable);
function ReadableStream (data) {
Stream.Readable.call(this);
this._data = data;
}
ReadableStream.prototype._read = function(n) {
this.push(this._data);
this._data = '';
};
ReadableStream.prototype.append = function(data) {
this.push(data);
};