lpad
Left pad each line in a string or stdout/stderr.
The stdout/stderr padding is especially useful in CLI tools when you don't directly control the output.
Getting started
Install: npm install lpad
Documentation
lpad(string, pad)
Pads each line in a string with the supplied pad string.
Example
var lpad = require('lpad');
var str = 'foo\nbar';
console.log(str);
console.log(lpad(str, ' '));
lpad.stdout(pad)
Pads each line of process.stdout
with the supplied pad string until the method is called again with no arguments.
Example
var lpad = require('lpad');
var str = 'foo\nbar';
lpad.stdout(' ');
console.log(str);
lpad.stdout();
console.log(str);
lpad.stderr(pad)
Pads each line of process.stderr
with the supplied pad string until the method is called again with no arguments.
License
MIT License
(c) Sindre Sorhus