3.0.0 • Published 3 years ago

pad-stdio v3.0.0

Weekly downloads
13,280
License
MIT
Repository
github
Last release
3 years ago

pad-stdio

Pad stdout and stderr

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

npm.io

Install

$ npm install pad-stdio

Usage

import {padStdout} from 'pad-stdio';

padStdout('  ');      // Start padding
console.log('foo');
padStdout('    ');
console.log('bar');
padStdout();          // End padding
console.log('baz');

/*
  foo
    bar
baz
*/

API

padStdout(padString)

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

padStderr(padString)

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