From dd8046ab66c19091f42024cddac7f903d6366ad0 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Wed, 22 Sep 2021 21:26:46 +0900 Subject: [PATCH] Make sure there's an env (#67, #68) --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 9e1a05f..af7ec69 100644 --- a/index.js +++ b/index.js @@ -1,9 +1,11 @@ import * as tty from "tty" -import { env, platform } from "process" +import process from "process" + +const env = process.env || {} const isDisabled = "NO_COLOR" in env const isForced = "FORCE_COLOR" in env -const isWindows = platform === "win32" +const isWindows = process.platform === "win32" const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && env.TERM !== "dumb"