mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 21:16:00 +00:00
17 lines
316 B
JavaScript
17 lines
316 B
JavaScript
const stream = require('stream');
|
|
|
|
class ObjectWriterStream extends stream.Writable {
|
|
_write(chunk, enc, next) {
|
|
console.log(JSON.stringify(chunk));
|
|
next();
|
|
}
|
|
}
|
|
|
|
async function consoleObjectWriter() {
|
|
return new ObjectWriterStream({
|
|
objectMode: true,
|
|
});
|
|
}
|
|
|
|
module.exports = consoleObjectWriter;
|