GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — std-env/src/flags.ts at main · unjs/std-env Expand file tree/ Copy pathflags.tsMore file actions 56 lines (41 loc) · 2.85 KB / Copy pathflags.tsFile metadata and controls56 lines (41 loc) · 2.85 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 import { providerInfo } from "./providers.ts"; import { env, nodeENV, process } from "./env.ts"; /** Value of process.platform */ export const platform: string = process.platform || ""; /** Detect if `CI` environment variable is set or a provider CI detected */ // `#__PURE__` IIFE so importing `isCI` is the only thing that pulls in `providerInfo` // (and the provider table); unrelated flags stay free of it. See AGENTS.md. export const isCI: boolean = /* #__PURE__ */ (() => !!env.CI || providerInfo.ci !== false)(); /** Detect if stdout.TTY is available */ export const hasTTY: boolean = !!process.stdout?.isTTY; /** Detect if global `window` object is available */ // eslint-disable-next-line unicorn/prefer-global-this export const hasWindow: boolean = typeof window !== "undefined"; /** Detect if `DEBUG` environment variable is set */ export const isDebug: boolean = !!env.DEBUG; /** Detect if `NODE_ENV` environment variable is `test` or `TEST` environment variable is set */ export const isTest: boolean = nodeENV === "test" || !!env.TEST; /** Detect if `NODE_ENV` or `MODE` environment variable is `production` */ export const isProduction: boolean = nodeENV === "production" || env.MODE === "production"; /** Detect if `NODE_ENV` environment variable is `dev` or `development`, or if `MODE` environment variable is `development` */ export const isDevelopment: boolean = nodeENV === "dev" || nodeENV === "development" || env.MODE === "development"; /** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */ // `#__PURE__` IIFE so this (which references `isCI`) doesn't pin `providerInfo` — // otherwise its impure `env.MINIMAL` access keeps it alive in every bundle. See AGENTS.md. export const isMinimal: boolean = /* #__PURE__ */ (() => !!env.MINIMAL || isCI || isTest || !hasTTY)(); /** Detect if process.platform is Windows */ export const isWindows: boolean = /^win/i.test(platform); /** Detect if process.platform is Linux */ export const isLinux: boolean = /^linux/i.test(platform); /** Detect if process.platform is macOS (darwin kernel) */ export const isMacOS: boolean = /^darwin/i.test(platform); /** Detect if terminal color output is supported based on `NO_COLOR`, `FORCE_COLOR`, TTY, and CI environment */ // `#__PURE__` IIFE so this (which references `isCI`) doesn't pin `providerInfo`. See AGENTS.md. export const isColorSupported: boolean = /* #__PURE__ */ (() => !env.NO_COLOR && (!!env.FORCE_COLOR || ((hasTTY || isWindows) && env.TERM !== "dumb") || isCI))(); /** Node.js version string (e.g. `"20.11.0"`), or `null` if not running in Node.js */ export const nodeVersion: string | null = (process.versions?.node || "").replace(/^v/, "") || null; /** Node.js major version number (e.g. `20`), or `null` if not running in Node.js */ export const nodeMajorVersion: number | null = Number(nodeVersion?.split(".")[0]) || null; |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |