Terminal emulating using node.js