interface ChannelProbe

The observable state detect reads. Every field defaults to this process, and every field is injectable so each channel is reachable in a test without that install existing.

import * as Channel from './channel.ts';

const probe: Channel.ChannelProbe = { execPath: '/usr/bin/node', platform: 'linux' };
probe.platform; // 'linux' — path rules follow this, not the host

Properties

optional
execPath: string

process.execPath: the compiled binary itself, or the node/deno that is running it.

optional
modulePath: string

Absolute path of a file inside the installed package — undefined inside a SEA bundle.

optional
platform: NodeJS.Platform

Path semantics to apply. Defaults to the host's.

optional
isDeno: boolean

Whether the Deno global is present, which is what separates a deno compile build from a SEA.

optional
fileExists: (target: string) => boolean

Existence probe for the only filesystem question asked: which manifest sits above the install.

optional
denoDir: string

An explicit DENO_DIR, which relocates the module cache off its recognisable path.

Usage

import { type ChannelProbe } from "lib/commands/upgrade/channel.ts";