mirror of
https://github.com/komari-monitor/komari.git
synced 2026-11-17 12:10:56 +00:00
24 lines
521 B
JavaScript
24 lines
521 B
JavaScript
(function (stream, hooks) {
|
|
"use strict";
|
|
|
|
const { Writable, Readable } = stream;
|
|
|
|
const stdout = new Writable({
|
|
write(chunk, encoding, callback) {
|
|
hooks.write("stdout", chunk, callback);
|
|
},
|
|
});
|
|
const stderr = new Writable({
|
|
write(chunk, encoding, callback) {
|
|
hooks.write("stderr", chunk, callback);
|
|
},
|
|
});
|
|
const stdin = new Readable({
|
|
read() {
|
|
// Standard input is not connected in jsruntime; the stream stays
|
|
// open and never produces data.
|
|
},
|
|
});
|
|
|
|
return { stdout, stderr, stdin };
|
|
}) |