Terminal emulation on node.js