编辑 | blame | 历史 | 原始文档

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