import type { ShellCommand } from "../shell-types"; import type { PmDeps } from "./pm-types"; import { VERSIONS, NPM_REGISTRY_URL_SLASH } from "../../constants/config"; const A_RESET = "\x1b[0m"; const A_BOLD = "\x1b[1m"; const A_CYAN = "\x1b[36m"; export function createNpmCommand(deps: PmDeps): ShellCommand { return { name: "npm", async execute(params, ctx) { if (!deps.hasFile("/")) return { stdout: "", stderr: "Volume unavailable\n", exitCode: 1 }; const sub = params[0]; if (!sub || sub === "help" || sub === "--help") { return { stdout: `${A_BOLD}Usage:${A_RESET} npm \n\n` + `${A_BOLD}Commands:${A_RESET}\n` + ` ${A_CYAN}run${A_RESET}