diff --git a/colors.mjs b/colors.mjs index 8532de6..2ebc29f 100644 --- a/colors.mjs +++ b/colors.mjs @@ -1,7 +1,7 @@ let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; if (typeof process !== 'undefined') { ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env); - isTTY = process.stdout.isTTY; + isTTY = process.stdout && process.stdout.isTTY; } export const $ = { diff --git a/index.mjs b/index.mjs index 98fb36f..6343543 100644 --- a/index.mjs +++ b/index.mjs @@ -3,7 +3,7 @@ let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; if (typeof process !== 'undefined') { ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env); - isTTY = process.stdout.isTTY; + isTTY = process.stdout && process.stdout.isTTY; } const $ = {