CommandDeps Command execution.
run_command
Run a command and return the result.
(cmd: string, args: Array<string>) => Promise<CommandResult>Shared dependency interfaces for runtime operations.
Small composable interfaces that functions accept for only the capabilities they need. Both Deno and Node implementations satisfy all these interfaces via RuntimeDeps.
11 declarations
CommandDeps Command execution.
run_commandRun a command and return the result.
(cmd: string, args: Array<string>) => Promise<CommandResult>CommandResult Result of executing a command.
successbooleancodenumberstdoutstringstderrstringEnvDeps Environment variable access.
env_getGet an environment variable value.
(name: string) => string | undefinedenv_setSet an environment variable.
(name: string, value: string) => voidFsReadDeps File system read operations.
statGet file/directory stats, or null if path doesn't exist.
(path: string) => Promise<StatResult | null>read_fileRead a file as text.
(path: string) => Promise<string>FsRemoveDeps File system remove operations.
removeRemove a file or directory.
(path: string, options?: {recursive?: boolean}) => Promise<void>FsWriteDeps File system write operations.
mkdirCreate a directory.
(path: string, options?: {recursive?: boolean}) => Promise<void>write_fileWrite text to a file.
(path: string, content: string) => Promise<void>renameRename (move) a file.
(old_path: string, new_path: string) => Promise<void>LogDeps Warning/diagnostic output.
warnLog a warning message.
(...args: Array<unknown>) => voidProcessDeps Process lifecycle.
exitExit the process with a code.
(code: number) => neverRuntimeDeps Full runtime capabilities returned by create_deno_runtime or create_node_runtime.
Extends all *Deps interfaces with additional app-level capabilities.
Functions should accept narrow *Deps interfaces, not this full type —
this type is for the wiring layer that creates and passes the runtime.
env_allGet all environment variables.
() => Record<string, string>argsCLI arguments passed to the program.
ReadonlyArray<string>cwdGet current working directory.
() => stringrun_command_inheritRun a command with inherited stdout/stderr (output goes directly to terminal).
(cmd: string, args: Array<string>) => Promise<number>StatResult Result of a stat operation.
is_filebooleanis_directorybooleanTerminalDeps Terminal I/O operations.
stdout_writeWrite bytes to stdout.
(data: Uint8Array) => Promise<number>stdin_readRead bytes from stdin, or null on EOF.
(buffer: Uint8Array) => Promise<number | null>