Node.js examples for String:Padding
String object extensions: pad from left
String.prototype.pad_left = function(pad_length, pad_string) { var new_string = this; for (var i = 0; new_string.length < pad_length; i++) { new_string = pad_string + new_string; }/*from ww w. j av a 2 s . c o m*/ return new_string; }