1
0
Fork 0
forked from svrjs/svrjs

Fix incompatibilites with Bun

This commit is contained in:
Dorian Niemiec 2024-04-27 13:51:05 +02:00
parent 7dfdc7209e
commit 583c66ca3d

11
svr.js
View file

@ -940,7 +940,16 @@ function calculateNetworkIPv4FromCidr(ipWithCidr) {
}).join("."); }).join(".");
} }
if (!process.stdout.isTTY && (!inspector || !inspector.url())) { var inspectorURL = undefined;
try {
if (inspector) {
inspectorURL = inspector.url();
}
} catch (err) {
// Failed to get inspector URL
}
if (!process.stdout.isTTY && !inspectorURL) {
// When stdout is not a terminal and not attached to an Node.JS inspector, disable it to improve performance of SVR.JS // When stdout is not a terminal and not attached to an Node.JS inspector, disable it to improve performance of SVR.JS
console.log = function () {}; console.log = function () {};
process.stdout.write = function () {}; process.stdout.write = function () {};