summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_util/os.ts
blob: 239419d91031bbd1419d37004596e876f3f0e639 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.

import { core } from "ext:core/mod.js";
const ops = core.ops;

export type OSType =
  | "windows"
  | "linux"
  | "android"
  | "darwin"
  | "freebsd"
  | "openbsd";

export const osType: OSType = ops.op_node_build_os();

export const isWindows = osType === "windows";
export const isLinux = osType === "linux" || osType === "android";