I have a simple readline shell written in Coffeescript:
rl = require \'readline\' cli = rl.createInterface process.std
You can clear screen using console.log() and escape sequences.
console.log()
cli.on 'line', (line) -> if line == 'cls' console.log("\033[2J\033[0f") else console.log line cli.prompt()