New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cli-interact

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-interact - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

examples/getInteger.js

50

index.js

@@ -31,2 +31,23 @@ //==============================

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 getIPversion () {

@@ -36,2 +57,30 @@ return getChar('IP Version', '46');

function getNumber (promptText, flagIntOnly) {
var answer;
var value;
promptText += ': ';
while (true) {
answer = readlineSync.question(promptText);
if (answer === "\u0003") {
// Ctl-C
process.exit();
} else {
if (flagIntOnly) {
value = parseInt(answer, 10);
if (value.toString() === answer) {
break;
}
} else {
value = parseFloat(answer);
if (!isNaN(value) && isFinite(answer)) {
break;
}
}
}
}
return value;
}
function getYesNo (title, flagAllowNoAnswer) {

@@ -73,2 +122,3 @@ var answer;

, getIPversion : getIPversion
, getNumber : getNumber
, getYesNo : getYesNo

@@ -75,0 +125,0 @@ , question : question

2

package.json
{
"name": "cli-interact",
"version": "0.1.1",
"version": "0.1.2",
"title": "cli interact",

@@ -5,0 +5,0 @@ "description": "Simple helper tools for interacting synchronously with user at command line",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc