Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
751 B

'use strict';
var Writable = require('./writable');
var Readable = require('./readable');
exports.createReadStream = function (opts) {
opts = opts || {};
return new Readable(this, opts);
};
exports.createWriteStream = function (opts) {
opts = opts || {};
return new Writable(this, opts);
};
var ep = require('./eventProxy');
var streamEvents = [
'drain',
'pipe',
'unpipe',
'error'
];
exports.write = function (chunk, encoding, callback) {
if (!this.__stream) {
this.__stream = new Writable(this);
ep(this, this.__stream, streamEvents);
this.on('destroy', function () {
this.__stream.end();
});
}
return this.__stream.write(chunk, encoding, callback);
};
exports.end = function () {
this.emit('done');
};