Skip to content

Commit

Permalink
fix: check process.stdout existence (#42)
Browse files Browse the repository at this point in the history
* Fixed browser support

* minor change
  • Loading branch information
tinchoz49 authored Sep 30, 2020
1 parent 2cc92dd commit 01963cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion colors.mjs
Original file line number Diff line number Diff line change
@@ -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 $ = {
Expand Down
2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 $ = {
Expand Down

0 comments on commit 01963cc

Please sign in to comment.