pad-stdio

Pad stdout and stderr

Usage no npm install needed!

<script type="module">
  import padStdio from 'https://cdn.skypack.dev/pad-stdio';
</script>

README

pad-stdio Build Status

Pad stdout and stderr

Especially useful with CLI tools when you don't directly control the output.

Install

$ npm install --save pad-stdio

Usage

var padStdio = require('pad-stdio');

padStdio.stdout('  ');      // start padding
console.log('foo');
padStdio.stdout('    ');
console.log('bar');
padStdio.stdout();          // end padding
console.log('baz');

/*
  foo
    bar
baz
*/

API

padStdio.stdout(pad)

Pads each line of process.stdout with the supplied pad string until the method is called again with no arguments.

padStdio.stderr(pad)

Pads each line of process.stderr with the supplied pad string until the method is called again with no arguments.

License

MIT © Sindre Sorhus