Skip to content
Pad each line in a stream
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
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

You can’t perform that action at this time.