A basic console input library
npm install node-console-input#### Accepting input
Code:
``javascript
const conif = require('node-console-input');
var name = conif.getConsoleInput("Name: ", false);
console.log("Hello, " + name + "\n");
var age = conif.getConsoleIntegerInput("Age: ");
console.log("You are " + name + " years old\n");
var height = conif.getConsoleFloatInput("Height: ");
console.log("You are " + height + " metres tall");
``
Output:
Name: myName
Hello, myName
Age: 27
You are 27 years old
Height: 2.25
You are 2.25 metres tall
`
defaults to false.
Will display prompText then will wait until user has inputed something, if acceptBlank is true will accept nothing as an input. When invalid input is detected will repeat prompt.
#### getConsoleIntegerInput (promptText)
Will display prompText then will wait until user has inputed something. When invalid input is detected will repeat prompt. Will truncate floats to integers.
#### getConsoleFloatInput (promptText)
Will display prompText` then will wait until user has inputed something. When invalid input is detected will repeat prompt.