done purchases remove, ocr scan, read image
This commit is contained in:
28
express-server/node_modules/streamifier/lib/index.js
generated
vendored
Normal file
28
express-server/node_modules/streamifier/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
var stream = require('stream');
|
||||
|
||||
module.exports.createReadStream = function (object, options) {
|
||||
return new MultiStream (object, options);
|
||||
};
|
||||
|
||||
var MultiStream = function (object, options) {
|
||||
if (object instanceof Buffer || typeof object === 'string') {
|
||||
options = options || {};
|
||||
stream.Readable.call(this, {
|
||||
highWaterMark: options.highWaterMark,
|
||||
encoding: options.encoding
|
||||
});
|
||||
} else {
|
||||
stream.Readable.call(this, { objectMode: true });
|
||||
}
|
||||
this._object = object;
|
||||
};
|
||||
|
||||
util.inherits(MultiStream, stream.Readable);
|
||||
|
||||
MultiStream.prototype._read = function () {
|
||||
this.push(this._object);
|
||||
this._object = null;
|
||||
};
|
Reference in New Issue
Block a user