So after @Luka967 mentioned the windows bug, I fixed it. But then, as I fixed it, I thought "Why don't I make it better?". So, I streamlined the entire thing into a module. And it has all you need.
CHANGES
Works for any OS
Left and right keys now allow you to edit your typed command
The module now has an easy way to use it
Fixed every bug I mentioned in #670
MODULE SPECS:
Usage:
var AsyncConsole = require('asyncconsole');
var input = new AsyncConsole("> ",function(str) { // arguments: AsyncConsole(prompttext,callback,test?)
// do something with str.
})
// other things:
input.pause() // pause it
input.resume() // resume
input.up() // stimulate up key
input.down() // stimulate down key
input.left() // stimulate left key
input.right() // stimulate right key
input.enter() // stimulate enter key
input.back() // stimulate back key
input.key(character) // stimulate inserting a character
So after @Luka967 mentioned the windows bug, I fixed it. But then, as I fixed it, I thought "Why don't I make it better?". So, I streamlined the entire thing into a module. And it has all you need.
CHANGES
MODULE SPECS:
Usage:
NPM: https://www.npmjs.com/package/asyncconsole