How to use the rpad function from underscore.string

Find comprehensive JavaScript underscore.string.rpad code examples handpicked from public code repositorys.

134
135
136
137
138
139
140
141
142
143
// Build the table
var text = '';
_.each(table, function(row) {
        var i = 0;
        _.each(row, function(col) {
                text += _s.rpad(_s.strip(col), widths[i++], ' ') + '   ';
        });
        text += '\n';
});
return text + '\n';
fork icon214
star icon0
watch icon3

72
73
74
75
76
77
78
79
80
81
	payload = "68640018636C" + hosts[index].macAddress + twenties + "0000000000" + hosts[index].state
	this.sendMessage(hex2ba(payload),remote.address);
	this.emit('subscription', remote.address);			
	break;
case "6864001d7274":
	namepad = _s.rpad(hosts[index].name, 16, " ");
	namepad = new Buffer(namepad);
	var ip = localIP.split(".");
	var ipHex = "";
	ip.forEach(function(e) {
fork icon6
star icon13
watch icon0

980
981
982
983
984
985
986
987
988
989
s.strip     = s.trim;
s.lstrip    = s.ltrim;
s.rstrip    = s.rtrim;
s.center    = s.lrpad;
s.rjust     = s.lpad;
s.ljust     = s.rpad;
s.contains  = s.include;
s.q         = s.quote;
s.toBool    = s.toBoolean;
s.camelcase = s.camelize;
fork icon0
star icon6
watch icon0