@nu-art/commando
Version:
Shell command execution framework with interactive sessions, CLI parameter resolution, and plugin system for building and executing shell scripts programmatically
60 lines (59 loc) • 2.07 kB
TypeScript
import { BaseCommando } from '../core/BaseCommando.js';
import { Commando_Programming } from './programming.js';
import { Commando_Basic } from './basic.js';
declare const Super: import("@nu-art/ts-common").Constructor<BaseCommando & Commando_Programming & Commando_Basic>;
/**
* NVM (Node Version Manager) plugin for Commando.
*
* Provides NVM operations for managing Node.js versions:
* - Install NVM
* - Apply NVM to shell session
* - Install specific Node.js versions
* - Get installed Node.js versions
*
* Extends Commando_Programming and Commando_Basic (merged).
*/
export declare class Commando_NVM extends Super {
/**
* Applies NVM to the shell session.
*
* Exports NVM_DIR, sources nvm.sh, and runs `nvm use`.
* Must be called before using NVM commands in an interactive shell.
*
* @returns This instance for method chaining
*/
applyNVM(): this;
/**
* Installs NVM by downloading and executing the install script.
*
* @param version - NVM version to install
* @returns This instance for method chaining
* @throws Exception if installation fails (non-zero exit code)
*/
install(version: string): Promise<this>;
/**
* Gets the installed NVM version.
*
* Only executes if NVM is available (checks with `command -v nvm`).
*
* @returns Promise resolving to NVM version string
*/
getVersion(): Promise<string>;
/**
* Installs a specific Node.js version via NVM.
*
* @param requiredVersion - Node.js version to install (e.g., '18.0.0')
* @returns This instance for method chaining
*/
installNodeVersion(requiredVersion: string): Promise<this>;
/**
* Gets all installed Node.js versions.
*
* Parses `nvm ls` output to extract version numbers, removing ANSI codes
* and filtering out invalid entries.
*
* @returns Promise resolving to array of version strings (without 'v' prefix)
*/
getInstalledNodeVersions: () => Promise<(string | undefined)[]>;
}
export {};