function prependSpaces(s, len) {
    while (s.length < len) {
        s = ' ' + s;
    }
    return s;
}
Simple util for prepending spaces to the string until it fits specified size.

@param {String} s
@param {Number} len
@returns {String}