String Builder implementation in node.js