< Summary - Envilder CLI

Information
Class: src/envilder/core/infrastructure/process/NodeProcessContext.ts
Assembly: Default
File(s): src/envilder/core/infrastructure/process/NodeProcessContext.ts
Tag: 561_41292037308
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 20
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

File(s)

src/envilder/core/infrastructure/process/NodeProcessContext.ts

#LineLine coverage
 1import { constants } from 'node:os';
 2import type { IProcessContext } from '../../domain/ports/IProcessContext.js';
 3
 4/**
 5 * Reads the live Node.js process: its environment and platform at call time,
 6 * and the platform's signal numbers.
 7 */
 8export class NodeProcessContext implements IProcessContext {
 9  environment(): Readonly<Record<string, string | undefined>> {
 2810    return process.env;
 11  }
 12
 13  platform(): string {
 6914    return process.platform;
 15  }
 16
 17  signalNumber(signal: NodeJS.Signals): number {
 118    return constants.signals[signal] ?? 0;
 19  }
 20}

Methods/Properties

environment
platform
signalNumber