cb-interview-demo
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,2 +5,18 @@ #!/usr/bin/env node | ||
const minimumVersion = '18.11' | ||
function isNodeLT (version) { | ||
const check = version.split('.').map(Number) | ||
const node = process.versions.node.split('.').map(Number) | ||
if(check[0] < node[0]) return true | ||
if(check[0] === node[0] && (check[1] && check[1] < node[1])) return true | ||
if(check[0] === node[0] && check[1] === node[1] && (check[2] && check[2] < node[2])) return true | ||
return false | ||
} | ||
if (isNodeLT(minimumVersion)) { | ||
console.error(`Node version must be ${minimumVersion} or greater.`) | ||
process.exit(1) | ||
} | ||
run() |
{ | ||
"name": "cb-interview-demo", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
1894
43