Pad each line in a stream
JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.travis.yml
index.js
license
package.json
readme.md
test.js

readme.md

pad-stream Build Status

Pad each line in a stream

Install

$ npm install --save pad-stream

Usage

// pad.js
const padStream = require('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)

Number of times to repeat indent.

indent

Type: string
Default: ' '

String to use as indent.

Related

License

MIT © Sindre Sorhus