lpad

Left pad each line in a string

lpad

Left pad each line in a string

$ npm install --save lpad
var lpad = require('lpad');
 
var str = 'foo\nbar';
/*
foo
bar
*/
 
lpad(str, '    ');
/*
    foo
    bar
*/

Pads each line in a string with the supplied pad string.

MIT © Sindre Sorhus