1
0
Fork 0
forked from svrjs/svrjs

When stdout is not a terminal, disable it to improve performance of SVR.JS

This commit is contained in:
Dorian Niemiec 2024-04-27 05:53:08 +02:00
parent 3a4cefa67a
commit 3839f4d1df

8
svr.js
View file

@ -934,6 +934,14 @@ function calculateNetworkIPv4FromCidr(ipWithCidr) {
}).join("."); }).join(".");
} }
if (!process.stdout.isTTY) {
// When stdout is not a terminal, disable it to improve performance of SVR.JS
console.log = function () {};
process.stdout.write = function () {};
process.stdout._write = function () {};
process.stdout._writev = function () {};
}
// IP and network inteface-related // IP and network inteface-related
var ifaces = {}; var ifaces = {};
var ifaceEx = null; var ifaceEx = null;