Hotroot: maybe require('readline') can do this for you. maybe osmething on npm