cli-interact
Advanced tools
Comparing version 0.1.2 to 0.1.3
22
index.js
@@ -31,21 +31,4 @@ //============================== | ||
function getInteger (promptText) { | ||
var answer; | ||
var value; | ||
promptText += ': '; | ||
while (true) { | ||
answer = readlineSync.question(promptText); | ||
if (answer === "\u0003") { | ||
// Ctl-C | ||
process.exit(); | ||
} else { | ||
value = parseInt(answer, 10); | ||
if (value.toString() === answer) { | ||
break; | ||
} | ||
} | ||
} | ||
return value; | ||
function getInteger (promptText) { // convenience method | ||
return getNumber(promptText, true); | ||
} | ||
@@ -120,2 +103,3 @@ | ||
getChar : getChar | ||
, getInteger : getInteger | ||
, getIPversion : getIPversion | ||
@@ -122,0 +106,0 @@ , getNumber : getNumber |
{ | ||
"name": "cli-interact", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"title": "cli interact", | ||
@@ -5,0 +5,0 @@ "description": "Simple helper tools for interacting synchronously with user at command line", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7962
177