Pad-stream: Pad Each Line in a Stream

Pad-stream

Pad each line in a stream

Install

npm install pad-stream

Usage

// pad.js
import padStream from 'pad-stream';

process.stdin.pipe(padStream(2, '>')).pipe(process.stdout);
$ echo 'foo\nbar' | node pad.js
>>foo
>>bar

API

padStream(count, indent?)

Returns a transform stream.

count

Type: number (integer)

The number of times to repeat indent.

indent

Type: string
Default: ' '

The string to use as indent.

Related


Download Details:

Author: Sindresorhus
Source Code: https://github.com/sindresorhus/pad-stream 
License: MIT license

#node #stream 

Pad-stream: Pad Each Line in a Stream
1.50 GEEK