Collect user input from a stream / stdin
npm install ee-simple-repl
All functions are chainable
var Repl = require('ee-repl');
// repl on stdin / stdout
var myRepl = new Repl();
// repl on custom streams
var myRepl = new Repl({
inputStream: myInputStream
, outputStream: myOutputStream
});
print some text
repl.say('hi');
print yellow text
repl.warn('seems not to be ok ...');
print red text
repl.error('nope, there was a problem');
print green text
repl.success('yeah, that was successhul!');
ask the user for single line input
repl.ask('How are you?', function(answer){
});
Ask the user for a y/n input
repl.confirm('Is the input ok?', function(isOk){
});