node-version-alias
Version:
Resolve Node.js version aliases like 'latest', 'lts' or 'erbium'
34 lines (20 loc) • 380 B
JavaScript
import{getNvmSystemVersion}from"./nvm.js";
export const getConstantAlias=(alias)=>{
const versionRange=ALIASES[alias];
if(versionRange===undefined){
return
}
if(typeof versionRange!=="function"){
return versionRange
}
return versionRange()
};
const ALIASES={
latest:"*",
stable:"*",
node:"*",
current:"*",
system:getNvmSystemVersion,
iojs:"4.0.0",
unstable:"0.11"
};