HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/AppData/Roaming/npm/node_modules/command-code/dist/index.mjs
#!/usr/bin/env node
var e=Object.defineProperty,__name=(o,r)=>e(o,"name",{value:r,configurable:!0});function parseNodeMajor(e){const o=Number.parseInt(e.replace(/^v/,""),10);return Number.isFinite(o)?o:null}__name(parseNodeMajor,"parseNodeMajor");var o=[{label:"n",command:"npm install -g n && n lts"},{label:"nvm",command:"nvm install --lts && nvm use --lts"}];function pad(e,o){return e+" ".repeat(Math.max(0,o-e.length))}function formatUnsupportedNodeMessage(e){const{nodeVersion:r,execPath:n,color:s}=e,t=__name(e=>s?`${e}`:e,"bold"),a=__name(e=>s?`${e}`:e,"red"),d=__name(e=>s?`${e}`:e,"dim"),i=Math.max(...o.map(e=>e.label.length),2);return["",a(t(`Command Code needs Node.js 22 or newer — you're on ${r}.`)),"",`Install the current Node LTS, then run ${t("cmd")} again:`,"",...o.map(e=>`  ${d(pad(e.label,i))}  ${e.command}`),`  ${d(pad("or",i))}  download from https://nodejs.org`,"","Other ways to upgrade (fnm, Volta, asdf, brew, Windows):","  https://commandcode.ai/docs/troubleshooting/common-issues#upgrading-node-js","",`If ${t("cmd")} still fails after upgrading, its bin is linked to the old`,`Node — reinstall it: ${t("npm i -g command-code")}`,"",d(`Current Node: ${n}`),""].join("\n")}function isSupportedNodeVersion(){const e=process.versions.node,o=parseNodeMajor(e);if(null===o||o>=22)return!0;const r=process.env;return process.stderr.write(formatUnsupportedNodeMessage({nodeVersion:`v${e.replace(/^v/,"")}`,execPath:process.execPath,color:!r.NO_COLOR&&!0===process.stderr.isTTY})),process.exitCode=1,!1}__name(pad,"pad"),__name(formatUnsupportedNodeMessage,"formatUnsupportedNodeMessage"),__name(isSupportedNodeVersion,"isSupportedNodeVersion");var r=process.env;r.NODE_ENV||(r.NODE_ENV="production"),isSupportedNodeVersion()&&await import(new URL("./cli.mjs",import.meta.url).href);